diff --git a/src/libs/Topaz/Generated/Topaz.AcceptRequestClient.AcceptVideoRequest.g.cs b/src/libs/Topaz/Generated/Topaz.AcceptRequestClient.AcceptVideoRequest.g.cs index d786ba3..379a8d8 100644 --- a/src/libs/Topaz/Generated/Topaz.AcceptRequestClient.AcceptVideoRequest.g.cs +++ b/src/libs/Topaz/Generated/Topaz.AcceptRequestClient.AcceptVideoRequest.g.cs @@ -381,18 +381,17 @@ partial void ProcessAcceptVideoRequestResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -419,18 +418,17 @@ partial void ProcessAcceptVideoRequestResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Payment required if ((int)__response.StatusCode == 402) @@ -457,18 +455,17 @@ partial void ProcessAcceptVideoRequestResponseContent( __exception_402 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Forbidden if ((int)__response.StatusCode == 403) @@ -495,18 +492,17 @@ partial void ProcessAcceptVideoRequestResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Enhancement request with the provided ID not found if ((int)__response.StatusCode == 404) @@ -533,18 +529,17 @@ partial void ProcessAcceptVideoRequestResponseContent( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -571,18 +566,17 @@ partial void ProcessAcceptVideoRequestResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Service unavailable if ((int)__response.StatusCode == 503) @@ -609,18 +603,17 @@ partial void ProcessAcceptVideoRequestResponseContent( __exception_503 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, - statusCode: __response.StatusCode) - { - ResponseBody = __content_503, - ResponseObject = __value_503, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -654,17 +647,15 @@ partial void ProcessAcceptVideoRequestResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -701,17 +692,15 @@ partial void ProcessAcceptVideoRequestResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.CancelClient.CancelTask.g.cs b/src/libs/Topaz/Generated/Topaz.CancelClient.CancelTask.g.cs index 70fe7bf..3e096f0 100644 --- a/src/libs/Topaz/Generated/Topaz.CancelClient.CancelTask.g.cs +++ b/src/libs/Topaz/Generated/Topaz.CancelClient.CancelTask.g.cs @@ -344,18 +344,17 @@ await CancelTaskAsResponseAsync( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -382,18 +381,17 @@ await CancelTaskAsResponseAsync( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -420,18 +418,17 @@ await CancelTaskAsResponseAsync( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The requested resource does not exist. if ((int)__response.StatusCode == 404) @@ -458,18 +455,17 @@ await CancelTaskAsResponseAsync( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request conflicts with the current state. if ((int)__response.StatusCode == 409) @@ -496,18 +492,17 @@ await CancelTaskAsResponseAsync( __exception_409 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -534,18 +529,17 @@ await CancelTaskAsResponseAsync( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -572,18 +566,17 @@ await CancelTaskAsResponseAsync( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -610,17 +603,15 @@ await CancelTaskAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -648,17 +639,15 @@ await CancelTaskAsResponseAsync( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.CancelRequestClient.CancelVideoRequest.g.cs b/src/libs/Topaz/Generated/Topaz.CancelRequestClient.CancelVideoRequest.g.cs index 1ad5c64..d76618e 100644 --- a/src/libs/Topaz/Generated/Topaz.CancelRequestClient.CancelVideoRequest.g.cs +++ b/src/libs/Topaz/Generated/Topaz.CancelRequestClient.CancelVideoRequest.g.cs @@ -359,18 +359,17 @@ partial void ProcessCancelVideoRequestResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -397,18 +396,17 @@ partial void ProcessCancelVideoRequestResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Forbidden if ((int)__response.StatusCode == 403) @@ -435,18 +433,17 @@ partial void ProcessCancelVideoRequestResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Enhancement request with the provided ID not found if ((int)__response.StatusCode == 404) @@ -473,18 +470,17 @@ partial void ProcessCancelVideoRequestResponseContent( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -511,18 +507,17 @@ partial void ProcessCancelVideoRequestResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -556,17 +551,15 @@ partial void ProcessCancelVideoRequestResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -603,17 +596,15 @@ partial void ProcessCancelVideoRequestResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.CompleteUploadClient.CompleteVideoUpload.g.cs b/src/libs/Topaz/Generated/Topaz.CompleteUploadClient.CompleteVideoUpload.g.cs index 2a54475..ff6757f 100644 --- a/src/libs/Topaz/Generated/Topaz.CompleteUploadClient.CompleteVideoUpload.g.cs +++ b/src/libs/Topaz/Generated/Topaz.CompleteUploadClient.CompleteVideoUpload.g.cs @@ -389,18 +389,17 @@ partial void ProcessCompleteVideoUploadResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -427,18 +426,17 @@ partial void ProcessCompleteVideoUploadResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Forbidden if ((int)__response.StatusCode == 403) @@ -465,18 +463,17 @@ partial void ProcessCompleteVideoUploadResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Enhancement request with the provided ID not found if ((int)__response.StatusCode == 404) @@ -503,18 +500,17 @@ partial void ProcessCompleteVideoUploadResponseContent( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -541,18 +537,17 @@ partial void ProcessCompleteVideoUploadResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -586,17 +581,15 @@ partial void ProcessCompleteVideoUploadResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -633,17 +626,15 @@ partial void ProcessCompleteVideoUploadResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.CreateExpressRequestClient.CreateExpressVideoRequest.g.cs b/src/libs/Topaz/Generated/Topaz.CreateExpressRequestClient.CreateExpressVideoRequest.g.cs index 57c5a7b..1044fa4 100644 --- a/src/libs/Topaz/Generated/Topaz.CreateExpressRequestClient.CreateExpressVideoRequest.g.cs +++ b/src/libs/Topaz/Generated/Topaz.CreateExpressRequestClient.CreateExpressVideoRequest.g.cs @@ -380,18 +380,17 @@ partial void ProcessCreateExpressVideoRequestResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -418,18 +417,17 @@ partial void ProcessCreateExpressVideoRequestResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -456,18 +454,17 @@ partial void ProcessCreateExpressVideoRequestResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Service unavailable if ((int)__response.StatusCode == 503) @@ -494,18 +491,17 @@ partial void ProcessCreateExpressVideoRequestResponseContent( __exception_503 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, - statusCode: __response.StatusCode) - { - ResponseBody = __content_503, - ResponseObject = __value_503, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -539,17 +535,15 @@ partial void ProcessCreateExpressVideoRequestResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -586,17 +580,15 @@ partial void ProcessCreateExpressVideoRequestResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.CreateRequestClient.CreateVideoRequest.g.cs b/src/libs/Topaz/Generated/Topaz.CreateRequestClient.CreateVideoRequest.g.cs index 86dd29f..4f54b2e 100644 --- a/src/libs/Topaz/Generated/Topaz.CreateRequestClient.CreateVideoRequest.g.cs +++ b/src/libs/Topaz/Generated/Topaz.CreateRequestClient.CreateVideoRequest.g.cs @@ -396,18 +396,17 @@ partial void ProcessCreateVideoRequestResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -434,18 +433,17 @@ partial void ProcessCreateVideoRequestResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -472,18 +470,17 @@ partial void ProcessCreateVideoRequestResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Service unavailable if ((int)__response.StatusCode == 503) @@ -510,18 +507,17 @@ partial void ProcessCreateVideoRequestResponseContent( __exception_503 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_503, - statusCode: __response.StatusCode) - { - ResponseBody = __content_503, - ResponseObject = __value_503, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -555,17 +551,15 @@ partial void ProcessCreateVideoRequestResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -602,17 +596,15 @@ partial void ProcessCreateVideoRequestResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.DeleteFilesClient.DeleteVideoFiles.g.cs b/src/libs/Topaz/Generated/Topaz.DeleteFilesClient.DeleteVideoFiles.g.cs index 056085f..0b1a4bc 100644 --- a/src/libs/Topaz/Generated/Topaz.DeleteFilesClient.DeleteVideoFiles.g.cs +++ b/src/libs/Topaz/Generated/Topaz.DeleteFilesClient.DeleteVideoFiles.g.cs @@ -350,18 +350,17 @@ await DeleteVideoFilesAsResponseAsync( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -388,18 +387,17 @@ await DeleteVideoFilesAsResponseAsync( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Forbidden if ((int)__response.StatusCode == 403) @@ -426,18 +424,17 @@ await DeleteVideoFilesAsResponseAsync( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Enhancement request with the provided ID not found if ((int)__response.StatusCode == 404) @@ -464,18 +461,17 @@ await DeleteVideoFilesAsResponseAsync( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -502,18 +498,17 @@ await DeleteVideoFilesAsResponseAsync( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -540,17 +535,15 @@ await DeleteVideoFilesAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -578,17 +571,15 @@ await DeleteVideoFilesAsResponseAsync( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.DenoiseClient.PostDenoise.g.cs b/src/libs/Topaz/Generated/Topaz.DenoiseClient.PostDenoise.g.cs index 8830941..e37497c 100644 --- a/src/libs/Topaz/Generated/Topaz.DenoiseClient.PostDenoise.g.cs +++ b/src/libs/Topaz/Generated/Topaz.DenoiseClient.PostDenoise.g.cs @@ -419,18 +419,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -457,18 +456,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Payment is required to access the resource. if ((int)__response.StatusCode == 402) @@ -495,18 +493,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_402 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -533,18 +530,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The preconditions to process the request were not met. if ((int)__response.StatusCode == 412) @@ -571,18 +567,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_412 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_412 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_412, - statusCode: __response.StatusCode) - { - ResponseBody = __content_412, - ResponseObject = __value_412, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_412, + responseObject: __value_412, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request is larger than the server is willing or able to process. if ((int)__response.StatusCode == 413) @@ -609,18 +604,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_413 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, - statusCode: __response.StatusCode) - { - ResponseBody = __content_413, - ResponseObject = __value_413, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request entity has a media type which the server or resource does not support. if ((int)__response.StatusCode == 415) @@ -647,18 +641,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_415 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, - statusCode: __response.StatusCode) - { - ResponseBody = __content_415, - ResponseObject = __value_415, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_415, + responseObject: __value_415, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was well-formed but was unable to be followed due to semantic errors. if ((int)__response.StatusCode == 422) @@ -685,18 +678,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_422 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was sent too early to be processed. Please wait before retrying. if ((int)__response.StatusCode == 425) @@ -723,18 +715,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_425 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_425 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_425, - statusCode: __response.StatusCode) - { - ResponseBody = __content_425, - ResponseObject = __value_425, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_425, + responseObject: __value_425, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -761,18 +752,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -799,18 +789,17 @@ partial void ProcessPostDenoiseResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -844,17 +833,15 @@ partial void ProcessPostDenoiseResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -891,17 +878,15 @@ partial void ProcessPostDenoiseResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.DownloadClient.GetDownloadInput.g.cs b/src/libs/Topaz/Generated/Topaz.DownloadClient.GetDownloadInput.g.cs index 01dbf41..79d8879 100644 --- a/src/libs/Topaz/Generated/Topaz.DownloadClient.GetDownloadInput.g.cs +++ b/src/libs/Topaz/Generated/Topaz.DownloadClient.GetDownloadInput.g.cs @@ -351,18 +351,17 @@ partial void ProcessGetDownloadInputResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -389,18 +388,17 @@ partial void ProcessGetDownloadInputResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -427,18 +425,17 @@ partial void ProcessGetDownloadInputResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The requested resource does not exist. if ((int)__response.StatusCode == 404) @@ -465,18 +462,17 @@ partial void ProcessGetDownloadInputResponseContent( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -503,18 +499,17 @@ partial void ProcessGetDownloadInputResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -541,18 +536,17 @@ partial void ProcessGetDownloadInputResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -586,17 +580,15 @@ partial void ProcessGetDownloadInputResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -633,17 +625,15 @@ partial void ProcessGetDownloadInputResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.DownloadClient.GetDownloadOutput.g.cs b/src/libs/Topaz/Generated/Topaz.DownloadClient.GetDownloadOutput.g.cs index bffed66..6403c44 100644 --- a/src/libs/Topaz/Generated/Topaz.DownloadClient.GetDownloadOutput.g.cs +++ b/src/libs/Topaz/Generated/Topaz.DownloadClient.GetDownloadOutput.g.cs @@ -351,18 +351,17 @@ partial void ProcessGetDownloadOutputResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -389,18 +388,17 @@ partial void ProcessGetDownloadOutputResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -427,18 +425,17 @@ partial void ProcessGetDownloadOutputResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The requested resource does not exist. if ((int)__response.StatusCode == 404) @@ -465,18 +462,17 @@ partial void ProcessGetDownloadOutputResponseContent( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request conflicts with the current state. if ((int)__response.StatusCode == 409) @@ -503,18 +499,17 @@ partial void ProcessGetDownloadOutputResponseContent( __exception_409 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -541,18 +536,17 @@ partial void ProcessGetDownloadOutputResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -579,18 +573,17 @@ partial void ProcessGetDownloadOutputResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -624,17 +617,15 @@ partial void ProcessGetDownloadOutputResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -671,17 +662,15 @@ partial void ProcessGetDownloadOutputResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.EnhanceClient.PostEnhance.g.cs b/src/libs/Topaz/Generated/Topaz.EnhanceClient.PostEnhance.g.cs index a3e8635..ea6b99f 100644 --- a/src/libs/Topaz/Generated/Topaz.EnhanceClient.PostEnhance.g.cs +++ b/src/libs/Topaz/Generated/Topaz.EnhanceClient.PostEnhance.g.cs @@ -443,18 +443,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -481,18 +480,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Payment is required to access the resource. if ((int)__response.StatusCode == 402) @@ -519,18 +517,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_402 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -557,18 +554,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The preconditions to process the request were not met. if ((int)__response.StatusCode == 412) @@ -595,18 +591,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_412 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_412 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_412, - statusCode: __response.StatusCode) - { - ResponseBody = __content_412, - ResponseObject = __value_412, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_412, + responseObject: __value_412, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request is larger than the server is willing or able to process. if ((int)__response.StatusCode == 413) @@ -633,18 +628,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_413 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, - statusCode: __response.StatusCode) - { - ResponseBody = __content_413, - ResponseObject = __value_413, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request entity has a media type which the server or resource does not support. if ((int)__response.StatusCode == 415) @@ -671,18 +665,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_415 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, - statusCode: __response.StatusCode) - { - ResponseBody = __content_415, - ResponseObject = __value_415, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_415, + responseObject: __value_415, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was well-formed but was unable to be followed due to semantic errors. if ((int)__response.StatusCode == 422) @@ -709,18 +702,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_422 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was sent too early to be processed. Please wait before retrying. if ((int)__response.StatusCode == 425) @@ -747,18 +739,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_425 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_425 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_425, - statusCode: __response.StatusCode) - { - ResponseBody = __content_425, - ResponseObject = __value_425, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_425, + responseObject: __value_425, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -785,18 +776,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -823,18 +813,17 @@ partial void ProcessPostEnhanceResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -868,17 +857,15 @@ partial void ProcessPostEnhanceResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -915,17 +902,15 @@ partial void ProcessPostEnhanceResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.EnhanceClient.PostEnhanceGen.g.cs b/src/libs/Topaz/Generated/Topaz.EnhanceClient.PostEnhanceGen.g.cs index a1d3ce0..ffab3c7 100644 --- a/src/libs/Topaz/Generated/Topaz.EnhanceClient.PostEnhanceGen.g.cs +++ b/src/libs/Topaz/Generated/Topaz.EnhanceClient.PostEnhanceGen.g.cs @@ -443,18 +443,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -481,18 +480,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Payment is required to access the resource. if ((int)__response.StatusCode == 402) @@ -519,18 +517,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_402 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -557,18 +554,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The preconditions to process the request were not met. if ((int)__response.StatusCode == 412) @@ -595,18 +591,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_412 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_412 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_412, - statusCode: __response.StatusCode) - { - ResponseBody = __content_412, - ResponseObject = __value_412, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_412, + responseObject: __value_412, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request is larger than the server is willing or able to process. if ((int)__response.StatusCode == 413) @@ -633,18 +628,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_413 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, - statusCode: __response.StatusCode) - { - ResponseBody = __content_413, - ResponseObject = __value_413, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request entity has a media type which the server or resource does not support. if ((int)__response.StatusCode == 415) @@ -671,18 +665,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_415 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, - statusCode: __response.StatusCode) - { - ResponseBody = __content_415, - ResponseObject = __value_415, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_415, + responseObject: __value_415, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was well-formed but was unable to be followed due to semantic errors. if ((int)__response.StatusCode == 422) @@ -709,18 +702,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_422 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was sent too early to be processed. Please wait before retrying. if ((int)__response.StatusCode == 425) @@ -747,18 +739,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_425 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_425 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_425, - statusCode: __response.StatusCode) - { - ResponseBody = __content_425, - ResponseObject = __value_425, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_425, + responseObject: __value_425, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -785,18 +776,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -823,18 +813,17 @@ partial void ProcessPostEnhanceGenResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -868,17 +857,15 @@ partial void ProcessPostEnhanceGenResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -915,17 +902,15 @@ partial void ProcessPostEnhanceGenResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.EstimateClient.PostEstimate.g.cs b/src/libs/Topaz/Generated/Topaz.EstimateClient.PostEstimate.g.cs index 8cfe159..0304e54 100644 --- a/src/libs/Topaz/Generated/Topaz.EstimateClient.PostEstimate.g.cs +++ b/src/libs/Topaz/Generated/Topaz.EstimateClient.PostEstimate.g.cs @@ -417,18 +417,17 @@ partial void ProcessPostEstimateResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -455,18 +454,17 @@ partial void ProcessPostEstimateResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -493,18 +491,17 @@ partial void ProcessPostEstimateResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -531,18 +528,17 @@ partial void ProcessPostEstimateResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -569,18 +565,17 @@ partial void ProcessPostEstimateResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -614,17 +609,15 @@ partial void ProcessPostEstimateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -661,17 +654,15 @@ partial void ProcessPostEstimateResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.EstimateClient.PostEstimateBulk.g.cs b/src/libs/Topaz/Generated/Topaz.EstimateClient.PostEstimateBulk.g.cs index 2cd4924..35a08ec 100644 --- a/src/libs/Topaz/Generated/Topaz.EstimateClient.PostEstimateBulk.g.cs +++ b/src/libs/Topaz/Generated/Topaz.EstimateClient.PostEstimateBulk.g.cs @@ -362,18 +362,17 @@ partial void ProcessPostEstimateBulkResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -400,18 +399,17 @@ partial void ProcessPostEstimateBulkResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -438,18 +436,17 @@ partial void ProcessPostEstimateBulkResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -476,18 +473,17 @@ partial void ProcessPostEstimateBulkResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -514,18 +510,17 @@ partial void ProcessPostEstimateBulkResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -559,17 +554,15 @@ partial void ProcessPostEstimateBulkResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -606,17 +599,15 @@ partial void ProcessPostEstimateBulkResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.EstimateClient.PostEstimateGen.g.cs b/src/libs/Topaz/Generated/Topaz.EstimateClient.PostEstimateGen.g.cs index f1ecb78..7aa5cbf 100644 --- a/src/libs/Topaz/Generated/Topaz.EstimateClient.PostEstimateGen.g.cs +++ b/src/libs/Topaz/Generated/Topaz.EstimateClient.PostEstimateGen.g.cs @@ -417,18 +417,17 @@ partial void ProcessPostEstimateGenResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -455,18 +454,17 @@ partial void ProcessPostEstimateGenResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -493,18 +491,17 @@ partial void ProcessPostEstimateGenResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -531,18 +528,17 @@ partial void ProcessPostEstimateGenResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -569,18 +565,17 @@ partial void ProcessPostEstimateGenResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -614,17 +609,15 @@ partial void ProcessPostEstimateGenResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -661,17 +654,15 @@ partial void ProcessPostEstimateGenResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.Exceptions.g.cs b/src/libs/Topaz/Generated/Topaz.Exceptions.g.cs index a761149..f61c4c0 100644 --- a/src/libs/Topaz/Generated/Topaz.Exceptions.g.cs +++ b/src/libs/Topaz/Generated/Topaz.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::Topaz.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Topaz.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::Topaz.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::Topaz.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::Topaz.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Topaz.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::Topaz.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::Topaz.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/Topaz/Generated/Topaz.GetRequestHistoryClient.GetHistory.g.cs b/src/libs/Topaz/Generated/Topaz.GetRequestHistoryClient.GetHistory.g.cs index 2e25d77..3cd693a 100644 --- a/src/libs/Topaz/Generated/Topaz.GetRequestHistoryClient.GetHistory.g.cs +++ b/src/libs/Topaz/Generated/Topaz.GetRequestHistoryClient.GetHistory.g.cs @@ -342,18 +342,17 @@ partial void ProcessGetHistoryResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Forbidden if ((int)__response.StatusCode == 403) @@ -380,18 +379,17 @@ partial void ProcessGetHistoryResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -418,18 +416,17 @@ partial void ProcessGetHistoryResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -463,17 +460,15 @@ partial void ProcessGetHistoryResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -510,17 +505,15 @@ partial void ProcessGetHistoryResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.GetRequestMetricsClient.GetVideoRequestMetrics.g.cs b/src/libs/Topaz/Generated/Topaz.GetRequestMetricsClient.GetVideoRequestMetrics.g.cs index 42e5d86..7f9c181 100644 --- a/src/libs/Topaz/Generated/Topaz.GetRequestMetricsClient.GetVideoRequestMetrics.g.cs +++ b/src/libs/Topaz/Generated/Topaz.GetRequestMetricsClient.GetVideoRequestMetrics.g.cs @@ -407,18 +407,17 @@ partial void ProcessGetVideoRequestMetricsResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Forbidden if ((int)__response.StatusCode == 403) @@ -445,18 +444,17 @@ partial void ProcessGetVideoRequestMetricsResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Enhancement request with the provided ID not found if ((int)__response.StatusCode == 404) @@ -483,18 +481,17 @@ partial void ProcessGetVideoRequestMetricsResponseContent( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -521,18 +518,17 @@ partial void ProcessGetVideoRequestMetricsResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -566,17 +562,15 @@ partial void ProcessGetVideoRequestMetricsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -613,17 +607,15 @@ partial void ProcessGetVideoRequestMetricsResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.GetRequestStatusClient.GetVideoRequestStatus.g.cs b/src/libs/Topaz/Generated/Topaz.GetRequestStatusClient.GetVideoRequestStatus.g.cs index 186c92d..adf8e90 100644 --- a/src/libs/Topaz/Generated/Topaz.GetRequestStatusClient.GetVideoRequestStatus.g.cs +++ b/src/libs/Topaz/Generated/Topaz.GetRequestStatusClient.GetVideoRequestStatus.g.cs @@ -433,18 +433,17 @@ partial void ProcessGetVideoRequestStatusResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Forbidden if ((int)__response.StatusCode == 403) @@ -471,18 +470,17 @@ partial void ProcessGetVideoRequestStatusResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Enhancement request with the provided ID not found if ((int)__response.StatusCode == 404) @@ -509,18 +507,17 @@ partial void ProcessGetVideoRequestStatusResponseContent( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error if ((int)__response.StatusCode == 500) @@ -547,18 +544,17 @@ partial void ProcessGetVideoRequestStatusResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -592,17 +588,15 @@ partial void ProcessGetVideoRequestStatusResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -639,17 +633,15 @@ partial void ProcessGetVideoRequestStatusResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.ImageStatusClient.DeleteAllStatuses.g.cs b/src/libs/Topaz/Generated/Topaz.ImageStatusClient.DeleteAllStatuses.g.cs index 6f905ab..abdb570 100644 --- a/src/libs/Topaz/Generated/Topaz.ImageStatusClient.DeleteAllStatuses.g.cs +++ b/src/libs/Topaz/Generated/Topaz.ImageStatusClient.DeleteAllStatuses.g.cs @@ -342,18 +342,17 @@ partial void ProcessDeleteAllStatusesResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -380,18 +379,17 @@ partial void ProcessDeleteAllStatusesResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -418,18 +416,17 @@ partial void ProcessDeleteAllStatusesResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -456,18 +453,17 @@ partial void ProcessDeleteAllStatusesResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -501,17 +497,15 @@ partial void ProcessDeleteAllStatusesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -548,17 +542,15 @@ partial void ProcessDeleteAllStatusesResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.ImageStatusClient.DeleteStatus.g.cs b/src/libs/Topaz/Generated/Topaz.ImageStatusClient.DeleteStatus.g.cs index 4895f75..fcf3412 100644 --- a/src/libs/Topaz/Generated/Topaz.ImageStatusClient.DeleteStatus.g.cs +++ b/src/libs/Topaz/Generated/Topaz.ImageStatusClient.DeleteStatus.g.cs @@ -344,18 +344,17 @@ await DeleteStatusAsResponseAsync( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -382,18 +381,17 @@ await DeleteStatusAsResponseAsync( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -420,18 +418,17 @@ await DeleteStatusAsResponseAsync( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The requested resource does not exist. if ((int)__response.StatusCode == 404) @@ -458,18 +455,17 @@ await DeleteStatusAsResponseAsync( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request conflicts with the current state. if ((int)__response.StatusCode == 409) @@ -496,18 +492,17 @@ await DeleteStatusAsResponseAsync( __exception_409 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -534,18 +529,17 @@ await DeleteStatusAsResponseAsync( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -572,18 +566,17 @@ await DeleteStatusAsResponseAsync( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -610,17 +603,15 @@ await DeleteStatusAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -648,17 +639,15 @@ await DeleteStatusAsResponseAsync( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.ImageStatusClient.GetAllStatuses.g.cs b/src/libs/Topaz/Generated/Topaz.ImageStatusClient.GetAllStatuses.g.cs index 19ffa65..45ae2a8 100644 --- a/src/libs/Topaz/Generated/Topaz.ImageStatusClient.GetAllStatuses.g.cs +++ b/src/libs/Topaz/Generated/Topaz.ImageStatusClient.GetAllStatuses.g.cs @@ -396,18 +396,17 @@ partial void ProcessGetAllStatusesResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -434,18 +433,17 @@ partial void ProcessGetAllStatusesResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -472,18 +470,17 @@ partial void ProcessGetAllStatusesResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -510,18 +507,17 @@ partial void ProcessGetAllStatusesResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -548,18 +544,17 @@ partial void ProcessGetAllStatusesResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -593,17 +588,15 @@ partial void ProcessGetAllStatusesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -640,17 +633,15 @@ partial void ProcessGetAllStatusesResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.ImageStatusClient.GetStatus.g.cs b/src/libs/Topaz/Generated/Topaz.ImageStatusClient.GetStatus.g.cs index 81b0d09..0a11048 100644 --- a/src/libs/Topaz/Generated/Topaz.ImageStatusClient.GetStatus.g.cs +++ b/src/libs/Topaz/Generated/Topaz.ImageStatusClient.GetStatus.g.cs @@ -351,18 +351,17 @@ partial void ProcessGetStatusResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -389,18 +388,17 @@ partial void ProcessGetStatusResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -427,18 +425,17 @@ partial void ProcessGetStatusResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The requested resource does not exist. if ((int)__response.StatusCode == 404) @@ -465,18 +462,17 @@ partial void ProcessGetStatusResponseContent( __exception_404 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -503,18 +499,17 @@ partial void ProcessGetStatusResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -541,18 +536,17 @@ partial void ProcessGetStatusResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -586,17 +580,15 @@ partial void ProcessGetStatusResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -633,17 +625,15 @@ partial void ProcessGetStatusResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.LightingClient.PostLighting.g.cs b/src/libs/Topaz/Generated/Topaz.LightingClient.PostLighting.g.cs index d3983fc..1147a9a 100644 --- a/src/libs/Topaz/Generated/Topaz.LightingClient.PostLighting.g.cs +++ b/src/libs/Topaz/Generated/Topaz.LightingClient.PostLighting.g.cs @@ -421,18 +421,17 @@ partial void ProcessPostLightingResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -459,18 +458,17 @@ partial void ProcessPostLightingResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Payment is required to access the resource. if ((int)__response.StatusCode == 402) @@ -497,18 +495,17 @@ partial void ProcessPostLightingResponseContent( __exception_402 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -535,18 +532,17 @@ partial void ProcessPostLightingResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The preconditions to process the request were not met. if ((int)__response.StatusCode == 412) @@ -573,18 +569,17 @@ partial void ProcessPostLightingResponseContent( __exception_412 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_412 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_412, - statusCode: __response.StatusCode) - { - ResponseBody = __content_412, - ResponseObject = __value_412, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_412, + responseObject: __value_412, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request is larger than the server is willing or able to process. if ((int)__response.StatusCode == 413) @@ -611,18 +606,17 @@ partial void ProcessPostLightingResponseContent( __exception_413 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, - statusCode: __response.StatusCode) - { - ResponseBody = __content_413, - ResponseObject = __value_413, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request entity has a media type which the server or resource does not support. if ((int)__response.StatusCode == 415) @@ -649,18 +643,17 @@ partial void ProcessPostLightingResponseContent( __exception_415 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, - statusCode: __response.StatusCode) - { - ResponseBody = __content_415, - ResponseObject = __value_415, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_415, + responseObject: __value_415, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was well-formed but was unable to be followed due to semantic errors. if ((int)__response.StatusCode == 422) @@ -687,18 +680,17 @@ partial void ProcessPostLightingResponseContent( __exception_422 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was sent too early to be processed. Please wait before retrying. if ((int)__response.StatusCode == 425) @@ -725,18 +717,17 @@ partial void ProcessPostLightingResponseContent( __exception_425 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_425 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_425, - statusCode: __response.StatusCode) - { - ResponseBody = __content_425, - ResponseObject = __value_425, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_425, + responseObject: __value_425, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -763,18 +754,17 @@ partial void ProcessPostLightingResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -801,18 +791,17 @@ partial void ProcessPostLightingResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -846,17 +835,15 @@ partial void ProcessPostLightingResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -893,17 +880,15 @@ partial void ProcessPostLightingResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.MattingClient.PostMatting.g.cs b/src/libs/Topaz/Generated/Topaz.MattingClient.PostMatting.g.cs index a910abb..a9019df 100644 --- a/src/libs/Topaz/Generated/Topaz.MattingClient.PostMatting.g.cs +++ b/src/libs/Topaz/Generated/Topaz.MattingClient.PostMatting.g.cs @@ -419,18 +419,17 @@ partial void ProcessPostMattingResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -457,18 +456,17 @@ partial void ProcessPostMattingResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Payment is required to access the resource. if ((int)__response.StatusCode == 402) @@ -495,18 +493,17 @@ partial void ProcessPostMattingResponseContent( __exception_402 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -533,18 +530,17 @@ partial void ProcessPostMattingResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The preconditions to process the request were not met. if ((int)__response.StatusCode == 412) @@ -571,18 +567,17 @@ partial void ProcessPostMattingResponseContent( __exception_412 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_412 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_412, - statusCode: __response.StatusCode) - { - ResponseBody = __content_412, - ResponseObject = __value_412, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_412, + responseObject: __value_412, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request is larger than the server is willing or able to process. if ((int)__response.StatusCode == 413) @@ -609,18 +604,17 @@ partial void ProcessPostMattingResponseContent( __exception_413 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, - statusCode: __response.StatusCode) - { - ResponseBody = __content_413, - ResponseObject = __value_413, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request entity has a media type which the server or resource does not support. if ((int)__response.StatusCode == 415) @@ -647,18 +641,17 @@ partial void ProcessPostMattingResponseContent( __exception_415 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, - statusCode: __response.StatusCode) - { - ResponseBody = __content_415, - ResponseObject = __value_415, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_415, + responseObject: __value_415, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was well-formed but was unable to be followed due to semantic errors. if ((int)__response.StatusCode == 422) @@ -685,18 +678,17 @@ partial void ProcessPostMattingResponseContent( __exception_422 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was sent too early to be processed. Please wait before retrying. if ((int)__response.StatusCode == 425) @@ -723,18 +715,17 @@ partial void ProcessPostMattingResponseContent( __exception_425 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_425 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_425, - statusCode: __response.StatusCode) - { - ResponseBody = __content_425, - ResponseObject = __value_425, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_425, + responseObject: __value_425, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -761,18 +752,17 @@ partial void ProcessPostMattingResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -799,18 +789,17 @@ partial void ProcessPostMattingResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -844,17 +833,15 @@ partial void ProcessPostMattingResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -891,17 +878,15 @@ partial void ProcessPostMattingResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.RestoreClient.PostRestoreGen.g.cs b/src/libs/Topaz/Generated/Topaz.RestoreClient.PostRestoreGen.g.cs index 5d69a37..12baa09 100644 --- a/src/libs/Topaz/Generated/Topaz.RestoreClient.PostRestoreGen.g.cs +++ b/src/libs/Topaz/Generated/Topaz.RestoreClient.PostRestoreGen.g.cs @@ -421,18 +421,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -459,18 +458,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Payment is required to access the resource. if ((int)__response.StatusCode == 402) @@ -497,18 +495,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_402 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -535,18 +532,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The preconditions to process the request were not met. if ((int)__response.StatusCode == 412) @@ -573,18 +569,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_412 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_412 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_412, - statusCode: __response.StatusCode) - { - ResponseBody = __content_412, - ResponseObject = __value_412, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_412, + responseObject: __value_412, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request is larger than the server is willing or able to process. if ((int)__response.StatusCode == 413) @@ -611,18 +606,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_413 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, - statusCode: __response.StatusCode) - { - ResponseBody = __content_413, - ResponseObject = __value_413, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request entity has a media type which the server or resource does not support. if ((int)__response.StatusCode == 415) @@ -649,18 +643,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_415 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, - statusCode: __response.StatusCode) - { - ResponseBody = __content_415, - ResponseObject = __value_415, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_415, + responseObject: __value_415, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was well-formed but was unable to be followed due to semantic errors. if ((int)__response.StatusCode == 422) @@ -687,18 +680,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_422 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was sent too early to be processed. Please wait before retrying. if ((int)__response.StatusCode == 425) @@ -725,18 +717,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_425 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_425 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_425, - statusCode: __response.StatusCode) - { - ResponseBody = __content_425, - ResponseObject = __value_425, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_425, + responseObject: __value_425, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -763,18 +754,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -801,18 +791,17 @@ partial void ProcessPostRestoreGenResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -846,17 +835,15 @@ partial void ProcessPostRestoreGenResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -893,17 +880,15 @@ partial void ProcessPostRestoreGenResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.SharpenClient.PostSharpen.g.cs b/src/libs/Topaz/Generated/Topaz.SharpenClient.PostSharpen.g.cs index a5b839a..48d2351 100644 --- a/src/libs/Topaz/Generated/Topaz.SharpenClient.PostSharpen.g.cs +++ b/src/libs/Topaz/Generated/Topaz.SharpenClient.PostSharpen.g.cs @@ -419,18 +419,17 @@ partial void ProcessPostSharpenResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -457,18 +456,17 @@ partial void ProcessPostSharpenResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Payment is required to access the resource. if ((int)__response.StatusCode == 402) @@ -495,18 +493,17 @@ partial void ProcessPostSharpenResponseContent( __exception_402 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -533,18 +530,17 @@ partial void ProcessPostSharpenResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The preconditions to process the request were not met. if ((int)__response.StatusCode == 412) @@ -571,18 +567,17 @@ partial void ProcessPostSharpenResponseContent( __exception_412 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_412 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_412, - statusCode: __response.StatusCode) - { - ResponseBody = __content_412, - ResponseObject = __value_412, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_412, + responseObject: __value_412, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request is larger than the server is willing or able to process. if ((int)__response.StatusCode == 413) @@ -609,18 +604,17 @@ partial void ProcessPostSharpenResponseContent( __exception_413 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, - statusCode: __response.StatusCode) - { - ResponseBody = __content_413, - ResponseObject = __value_413, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request entity has a media type which the server or resource does not support. if ((int)__response.StatusCode == 415) @@ -647,18 +641,17 @@ partial void ProcessPostSharpenResponseContent( __exception_415 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, - statusCode: __response.StatusCode) - { - ResponseBody = __content_415, - ResponseObject = __value_415, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_415, + responseObject: __value_415, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was well-formed but was unable to be followed due to semantic errors. if ((int)__response.StatusCode == 422) @@ -685,18 +678,17 @@ partial void ProcessPostSharpenResponseContent( __exception_422 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was sent too early to be processed. Please wait before retrying. if ((int)__response.StatusCode == 425) @@ -723,18 +715,17 @@ partial void ProcessPostSharpenResponseContent( __exception_425 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_425 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_425, - statusCode: __response.StatusCode) - { - ResponseBody = __content_425, - ResponseObject = __value_425, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_425, + responseObject: __value_425, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -761,18 +752,17 @@ partial void ProcessPostSharpenResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -799,18 +789,17 @@ partial void ProcessPostSharpenResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -844,17 +833,15 @@ partial void ProcessPostSharpenResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -891,17 +878,15 @@ partial void ProcessPostSharpenResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.SharpenClient.PostSharpenGen.g.cs b/src/libs/Topaz/Generated/Topaz.SharpenClient.PostSharpenGen.g.cs index ebb58f7..51d2259 100644 --- a/src/libs/Topaz/Generated/Topaz.SharpenClient.PostSharpenGen.g.cs +++ b/src/libs/Topaz/Generated/Topaz.SharpenClient.PostSharpenGen.g.cs @@ -419,18 +419,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -457,18 +456,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Payment is required to access the resource. if ((int)__response.StatusCode == 402) @@ -495,18 +493,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_402 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -533,18 +530,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The preconditions to process the request were not met. if ((int)__response.StatusCode == 412) @@ -571,18 +567,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_412 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_412 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_412, - statusCode: __response.StatusCode) - { - ResponseBody = __content_412, - ResponseObject = __value_412, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_412, + responseObject: __value_412, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request is larger than the server is willing or able to process. if ((int)__response.StatusCode == 413) @@ -609,18 +604,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_413 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, - statusCode: __response.StatusCode) - { - ResponseBody = __content_413, - ResponseObject = __value_413, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request entity has a media type which the server or resource does not support. if ((int)__response.StatusCode == 415) @@ -647,18 +641,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_415 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, - statusCode: __response.StatusCode) - { - ResponseBody = __content_415, - ResponseObject = __value_415, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_415, + responseObject: __value_415, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was well-formed but was unable to be followed due to semantic errors. if ((int)__response.StatusCode == 422) @@ -685,18 +678,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_422 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was sent too early to be processed. Please wait before retrying. if ((int)__response.StatusCode == 425) @@ -723,18 +715,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_425 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_425 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_425, - statusCode: __response.StatusCode) - { - ResponseBody = __content_425, - ResponseObject = __value_425, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_425, + responseObject: __value_425, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -761,18 +752,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -799,18 +789,17 @@ partial void ProcessPostSharpenGenResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -844,17 +833,15 @@ partial void ProcessPostSharpenGenResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -891,17 +878,15 @@ partial void ProcessPostSharpenGenResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.ToolClient.PostTool.g.cs b/src/libs/Topaz/Generated/Topaz.ToolClient.PostTool.g.cs index f5613b2..44a98d4 100644 --- a/src/libs/Topaz/Generated/Topaz.ToolClient.PostTool.g.cs +++ b/src/libs/Topaz/Generated/Topaz.ToolClient.PostTool.g.cs @@ -443,18 +443,17 @@ partial void ProcessPostToolResponseContent( __exception_400 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.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)); } // Authentication is required and has failed or has not yet been provided. if ((int)__response.StatusCode == 401) @@ -481,18 +480,17 @@ partial void ProcessPostToolResponseContent( __exception_401 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Payment is required to access the resource. if ((int)__response.StatusCode == 402) @@ -519,18 +517,17 @@ partial void ProcessPostToolResponseContent( __exception_402 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The API key doesn't have permissions to perform the request. if ((int)__response.StatusCode == 403) @@ -557,18 +554,17 @@ partial void ProcessPostToolResponseContent( __exception_403 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The preconditions to process the request were not met. if ((int)__response.StatusCode == 412) @@ -595,18 +591,17 @@ partial void ProcessPostToolResponseContent( __exception_412 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_412 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_412, - statusCode: __response.StatusCode) - { - ResponseBody = __content_412, - ResponseObject = __value_412, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_412, + responseObject: __value_412, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request is larger than the server is willing or able to process. if ((int)__response.StatusCode == 413) @@ -633,18 +628,17 @@ partial void ProcessPostToolResponseContent( __exception_413 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_413, - statusCode: __response.StatusCode) - { - ResponseBody = __content_413, - ResponseObject = __value_413, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_413, + responseObject: __value_413, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request entity has a media type which the server or resource does not support. if ((int)__response.StatusCode == 415) @@ -671,18 +665,17 @@ partial void ProcessPostToolResponseContent( __exception_415 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_415 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_415, - statusCode: __response.StatusCode) - { - ResponseBody = __content_415, - ResponseObject = __value_415, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_415, + responseObject: __value_415, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was well-formed but was unable to be followed due to semantic errors. if ((int)__response.StatusCode == 422) @@ -709,18 +702,17 @@ partial void ProcessPostToolResponseContent( __exception_422 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // The request was sent too early to be processed. Please wait before retrying. if ((int)__response.StatusCode == 425) @@ -747,18 +739,17 @@ partial void ProcessPostToolResponseContent( __exception_425 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_425 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_425, - statusCode: __response.StatusCode) - { - ResponseBody = __content_425, - ResponseObject = __value_425, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_425, + responseObject: __value_425, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests. if ((int)__response.StatusCode == 429) @@ -785,18 +776,17 @@ partial void ProcessPostToolResponseContent( __exception_429 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unexpected error on our end. if ((int)__response.StatusCode == 500) @@ -823,18 +813,17 @@ partial void ProcessPostToolResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -868,17 +857,15 @@ partial void ProcessPostToolResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -915,17 +902,15 @@ partial void ProcessPostToolResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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/Topaz/Generated/Topaz.VideoStatusClient.GetSystemStatus.g.cs b/src/libs/Topaz/Generated/Topaz.VideoStatusClient.GetSystemStatus.g.cs index b5d3ab6..e996d4a 100644 --- a/src/libs/Topaz/Generated/Topaz.VideoStatusClient.GetSystemStatus.g.cs +++ b/src/libs/Topaz/Generated/Topaz.VideoStatusClient.GetSystemStatus.g.cs @@ -354,18 +354,17 @@ partial void ProcessGetSystemStatusResponseContent( __exception_500 = __ex; } - throw new global::Topaz.ApiException( + + throw global::Topaz.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -399,17 +398,15 @@ partial void ProcessGetSystemStatusResponseContent( } catch (global::System.Exception __ex) { - throw new global::Topaz.ApiException( + throw global::Topaz.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 @@ -446,17 +443,15 @@ partial void ProcessGetSystemStatusResponseContent( { } - throw new global::Topaz.ApiException( + throw global::Topaz.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)); } }