diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.DeleteTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.DeleteTemplate.g.cs index 1606607..6160786 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.DeleteTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.DeleteTemplate.g.cs @@ -331,17 +331,15 @@ await DeleteTemplateAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -369,17 +367,15 @@ await DeleteTemplateAsResponseAsync( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetRender.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetRender.g.cs index dcb9236..b8fb6b5 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetRender.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetRender.g.cs @@ -345,17 +345,15 @@ partial void ProcessGetRenderResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -392,17 +390,15 @@ partial void ProcessGetRenderResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplate.g.cs index fd850c8..d0577f5 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplate.g.cs @@ -345,17 +345,15 @@ partial void ProcessGetTemplateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -392,17 +390,15 @@ partial void ProcessGetTemplateResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplates.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplates.g.cs index 6626333..6697bbe 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplates.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.GetTemplates.g.cs @@ -336,17 +336,15 @@ partial void ProcessGetTemplatesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -383,17 +381,15 @@ partial void ProcessGetTemplatesResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostRender.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostRender.g.cs index fe18610..396f97c 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostRender.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostRender.g.cs @@ -378,17 +378,15 @@ partial void ProcessPostRenderResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -425,17 +423,15 @@ partial void ProcessPostRenderResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplate.g.cs index a9fae90..b4b1b4b 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplate.g.cs @@ -360,17 +360,15 @@ partial void ProcessPostTemplateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -407,17 +405,15 @@ partial void ProcessPostTemplateResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplateRender.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplateRender.g.cs index 03baf4e..ebe764d 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplateRender.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PostTemplateRender.g.cs @@ -358,17 +358,15 @@ partial void ProcessPostTemplateRenderResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -405,17 +403,15 @@ partial void ProcessPostTemplateRenderResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.Probe.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.Probe.g.cs index a3ab263..376afcf 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.Probe.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.Probe.g.cs @@ -349,17 +349,15 @@ partial void ProcessProbeResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -396,17 +394,15 @@ partial void ProcessProbeResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.EditClient.PutTemplate.g.cs b/src/libs/Shotstack/Generated/Shotstack.EditClient.PutTemplate.g.cs index 55b4024..3f3d677 100644 --- a/src/libs/Shotstack/Generated/Shotstack.EditClient.PutTemplate.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.EditClient.PutTemplate.g.cs @@ -365,17 +365,15 @@ partial void ProcessPutTemplateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -412,17 +410,15 @@ partial void ProcessPutTemplateResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.Exceptions.g.cs b/src/libs/Shotstack/Generated/Shotstack.Exceptions.g.cs index 07e331d..3133ac2 100644 --- a/src/libs/Shotstack/Generated/Shotstack.Exceptions.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.Exceptions.g.cs @@ -12,16 +12,19 @@ public partial class ApiException : global::System.Exception /// The HTTP status code of the response. /// public global::System.Net.HttpStatusCode StatusCode { get; } + /// /// The response body as a string, or null if the body could not be read. /// This is always populated for error responses regardless of the ReadResponseAsString setting. /// For success-path failures (e.g. deserialization errors), the client attempts a best-effort read. /// public string? ResponseBody { get; set; } + /// /// The response headers. /// public global::System.Collections.Generic.Dictionary>? ResponseHeaders { get; set; } + /// /// Initializes a new instance of the class. /// @@ -49,6 +52,103 @@ public ApiException(string message, global::System.Exception? innerException, gl { StatusCode = statusCode; } + + /// + /// Constructs an instance whose runtime type matches the response status code when the typed exception hierarchy is enabled. Always returns a plain when the hierarchy is disabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static global::Shotstack.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Shotstack.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::Shotstack.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::Shotstack.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseHeaders = responseHeaders; + return exception; + } + + /// + /// Parses a Retry-After response header (delta-seconds or HTTP-date) into a . + /// Returns null when the header is missing or unparseable. Public so consumer code that observes + /// directly can recover the value without re-implementing the parser. + /// + public static global::System.TimeSpan? TryParseRetryAfter( + global::System.Collections.Generic.IDictionary>? headers) + { + if (headers == null) + { + return null; + } + + global::System.Collections.Generic.IEnumerable? values = null; + foreach (var entry in headers) + { + if (string.Equals(entry.Key, "Retry-After", global::System.StringComparison.OrdinalIgnoreCase)) + { + values = entry.Value; + break; + } + } + + if (values == null) + { + return null; + } + + string? raw = null; + foreach (var value in values) + { + if (!string.IsNullOrWhiteSpace(value)) + { + raw = value.Trim(); + break; + } + } + + if (string.IsNullOrEmpty(raw)) + { + return null; + } + + if (int.TryParse( + raw, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var seconds) && seconds >= 0) + { + return global::System.TimeSpan.FromSeconds(seconds); + } + + if (global::System.DateTimeOffset.TryParse( + raw, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var when)) + { + var delta = when - global::System.DateTimeOffset.UtcNow; + return delta > global::System.TimeSpan.Zero ? delta : global::System.TimeSpan.Zero; + } + + return null; + } } /// @@ -88,5 +188,39 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) { } + + /// + /// Constructs an whose runtime type matches the response status code when the typed exception hierarchy is enabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static new global::Shotstack.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Shotstack.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::Shotstack.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + T? responseObject, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::Shotstack.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseObject = responseObject; + exception.ResponseHeaders = responseHeaders; + return exception; + } } } \ No newline at end of file diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.DeleteSource.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.DeleteSource.g.cs index 406a689..146c5f4 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.DeleteSource.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.DeleteSource.g.cs @@ -331,17 +331,15 @@ await DeleteSourceAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -369,17 +367,15 @@ await DeleteSourceAsResponseAsync( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSource.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSource.g.cs index 89ac1db..a1c8068 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSource.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSource.g.cs @@ -345,17 +345,15 @@ partial void ProcessGetSourceResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -392,17 +390,15 @@ partial void ProcessGetSourceResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSources.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSources.g.cs index d5d87ee..b791f1b 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSources.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetSources.g.cs @@ -336,17 +336,15 @@ partial void ProcessGetSourcesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -383,17 +381,15 @@ partial void ProcessGetSourcesResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetUploadSignedUrl.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetUploadSignedUrl.g.cs index c90f305..ac5ed27 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetUploadSignedUrl.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.GetUploadSignedUrl.g.cs @@ -358,17 +358,15 @@ partial void ProcessGetUploadSignedUrlResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -405,17 +403,15 @@ partial void ProcessGetUploadSignedUrlResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.IngestClient.PostSource.g.cs b/src/libs/Shotstack/Generated/Shotstack.IngestClient.PostSource.g.cs index 2839630..1a86ae7 100644 --- a/src/libs/Shotstack/Generated/Shotstack.IngestClient.PostSource.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.IngestClient.PostSource.g.cs @@ -351,18 +351,17 @@ partial void ProcessPostSourceResponseContent( __exception_400 = __ex; } - throw new global::Shotstack.ApiException( + + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -396,17 +395,15 @@ partial void ProcessPostSourceResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -443,17 +440,15 @@ partial void ProcessPostSourceResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.ServeClient.DeleteAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.ServeClient.DeleteAsset.g.cs index c6a0590..c604580 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ServeClient.DeleteAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ServeClient.DeleteAsset.g.cs @@ -333,17 +333,15 @@ await DeleteAssetAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -371,17 +369,15 @@ await DeleteAssetAsResponseAsync( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAsset.g.cs index 9e0a826..e9f0933 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAsset.g.cs @@ -349,17 +349,15 @@ partial void ProcessGetAssetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -396,17 +394,15 @@ partial void ProcessGetAssetResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAssetByRenderId.g.cs b/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAssetByRenderId.g.cs index 3f1e6a4..8cab074 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAssetByRenderId.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ServeClient.GetAssetByRenderId.g.cs @@ -349,17 +349,15 @@ partial void ProcessGetAssetByRenderIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -396,17 +394,15 @@ partial void ProcessGetAssetByRenderIdResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/Shotstack/Generated/Shotstack.ServeClient.PostServeAsset.g.cs b/src/libs/Shotstack/Generated/Shotstack.ServeClient.PostServeAsset.g.cs index 2f8d85f..b18fb37 100644 --- a/src/libs/Shotstack/Generated/Shotstack.ServeClient.PostServeAsset.g.cs +++ b/src/libs/Shotstack/Generated/Shotstack.ServeClient.PostServeAsset.g.cs @@ -358,17 +358,15 @@ partial void ProcessPostServeAssetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -405,17 +403,15 @@ partial void ProcessPostServeAssetResponseContent( { } - throw new global::Shotstack.ApiException( + throw global::Shotstack.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } }