diff --git a/src/libs/Picsart/Generated/Picsart.Exceptions.g.cs b/src/libs/Picsart/Generated/Picsart.Exceptions.g.cs index 5aa3f54..365bdfd 100644 --- a/src/libs/Picsart/Generated/Picsart.Exceptions.g.cs +++ b/src/libs/Picsart/Generated/Picsart.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::Picsart.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Picsart.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::Picsart.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::Picsart.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::Picsart.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Picsart.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::Picsart.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::Picsart.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/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiExpandImage.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiExpandImage.g.cs index 96fe283..a66b923 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiExpandImage.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiExpandImage.g.cs @@ -363,18 +363,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -401,18 +400,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -439,18 +437,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -477,18 +474,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -515,18 +511,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -553,18 +548,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -591,18 +585,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -629,18 +622,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -667,18 +659,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -705,18 +696,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -743,18 +733,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -781,18 +770,17 @@ partial void ProcessGenaiExpandImageResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -826,17 +814,15 @@ partial void ProcessGenaiExpandImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -873,17 +859,15 @@ partial void ProcessGenaiExpandImageResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiGenerateImageBleed.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiGenerateImageBleed.g.cs index 7115b7c..80f6ea3 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiGenerateImageBleed.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiGenerateImageBleed.g.cs @@ -361,18 +361,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -399,18 +398,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -437,18 +435,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -475,18 +472,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -513,18 +509,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -551,18 +546,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -589,18 +583,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -627,18 +620,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -665,18 +657,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -703,18 +694,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -741,18 +731,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -779,18 +768,17 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -824,17 +812,15 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -871,17 +857,15 @@ partial void ProcessGenaiGenerateImageBleedResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpainting.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpainting.g.cs index 7708e48..476d13c 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpainting.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpainting.g.cs @@ -359,18 +359,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessGenaiImageInpaintingResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -663,18 +655,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -701,18 +692,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -739,18 +729,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -777,18 +766,17 @@ partial void ProcessGenaiImageInpaintingResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -822,17 +810,15 @@ partial void ProcessGenaiImageInpaintingResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -869,17 +855,15 @@ partial void ProcessGenaiImageInpaintingResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpaintingGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpaintingGetresult.g.cs index f004c10..04f0092 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpaintingGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageInpaintingGetresult.g.cs @@ -353,18 +353,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -391,18 +390,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -429,18 +427,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -467,18 +464,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -505,18 +501,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -543,18 +538,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -581,18 +575,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -619,18 +612,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -657,18 +649,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -695,18 +686,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -733,18 +723,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -771,18 +760,17 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -816,17 +804,15 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -863,17 +849,15 @@ partial void ProcessGenaiImageInpaintingGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageOutpainting.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageOutpainting.g.cs index 8a9843e..22f77b8 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageOutpainting.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiImageOutpainting.g.cs @@ -365,18 +365,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -403,18 +402,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -441,18 +439,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -479,18 +476,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -517,18 +513,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -555,18 +550,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -593,18 +587,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -631,18 +624,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -669,18 +661,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -707,18 +698,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -745,18 +735,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -783,18 +772,17 @@ partial void ProcessGenaiImageOutpaintingResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -828,17 +816,15 @@ partial void ProcessGenaiImageOutpaintingResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -875,17 +861,15 @@ partial void ProcessGenaiImageOutpaintingResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiRemoveObject.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiRemoveObject.g.cs index 0cb7223..06dbd60 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiRemoveObject.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiRemoveObject.g.cs @@ -361,18 +361,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -399,18 +398,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -437,18 +435,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -475,18 +472,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -513,18 +509,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -551,18 +546,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -589,18 +583,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -627,18 +620,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -665,18 +657,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -703,18 +694,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -741,18 +731,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -779,18 +768,17 @@ partial void ProcessGenaiRemoveObjectResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -824,17 +812,15 @@ partial void ProcessGenaiRemoveObjectResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -871,17 +857,15 @@ partial void ProcessGenaiRemoveObjectResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiSmartBackground.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiSmartBackground.g.cs index acb6b9c..4e45712 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiSmartBackground.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIInpaintingImage2ImageClient.GenaiSmartBackground.g.cs @@ -367,18 +367,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -405,18 +404,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -443,18 +441,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -481,18 +478,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -519,18 +515,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -557,18 +552,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -595,18 +589,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -633,18 +626,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -671,18 +663,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -709,18 +700,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -747,18 +737,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -785,18 +774,17 @@ partial void ProcessGenaiSmartBackgroundResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -830,17 +818,15 @@ partial void ProcessGenaiSmartBackgroundResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -877,17 +863,15 @@ partial void ProcessGenaiSmartBackgroundResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2audioGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2audioGetresult.g.cs index 46fce9a..75b3d42 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2audioGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2audioGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -617,18 +610,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -655,18 +647,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -693,18 +684,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -731,18 +721,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -769,18 +758,17 @@ partial void ProcessGenaiText2audioGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -814,17 +802,15 @@ partial void ProcessGenaiText2audioGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -861,17 +847,15 @@ partial void ProcessGenaiText2audioGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2sound.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2sound.g.cs index 28912ea..ca3b5f8 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2sound.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2sound.g.cs @@ -360,18 +360,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessGenaiText2soundResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessGenaiText2soundResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessGenaiText2soundResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2speech.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2speech.g.cs index 640e999..a08e6f6 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2speech.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2AudioClient.GenaiText2speech.g.cs @@ -360,18 +360,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessGenaiText2speechResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessGenaiText2speechResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessGenaiText2speechResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogo.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogo.g.cs index a10f7d6..415a211 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogo.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogo.g.cs @@ -359,18 +359,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessGenaiGenerateLogoResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -663,18 +655,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -701,18 +692,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -739,18 +729,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -777,18 +766,17 @@ partial void ProcessGenaiGenerateLogoResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -822,17 +810,15 @@ partial void ProcessGenaiGenerateLogoResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -869,17 +855,15 @@ partial void ProcessGenaiGenerateLogoResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogoGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogoGetresult.g.cs index b1129c2..853f123 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogoGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiGenerateLogoGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -617,18 +610,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -655,18 +647,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -693,18 +684,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -731,18 +721,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -769,18 +758,17 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -814,17 +802,15 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -861,17 +847,15 @@ partial void ProcessGenaiGenerateLogoGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2image.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2image.g.cs index 3775020..2d5d6f1 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2image.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2image.g.cs @@ -362,18 +362,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -400,18 +399,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -438,18 +436,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -476,18 +473,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -514,18 +510,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -552,18 +547,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -590,18 +584,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -628,18 +621,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -666,18 +658,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -704,18 +695,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -742,18 +732,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -780,18 +769,17 @@ partial void ProcessGenaiText2imageResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -825,17 +813,15 @@ partial void ProcessGenaiText2imageResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -872,17 +858,15 @@ partial void ProcessGenaiText2imageResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2imageGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2imageGetresult.g.cs index 8687ce4..027e793 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2imageGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2imageGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -617,18 +610,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -655,18 +647,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -693,18 +684,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -731,18 +721,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -769,18 +758,17 @@ partial void ProcessGenaiText2imageGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -814,17 +802,15 @@ partial void ProcessGenaiText2imageGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -861,17 +847,15 @@ partial void ProcessGenaiText2imageGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2sticker.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2sticker.g.cs index dadeceb..974111b 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2sticker.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2sticker.g.cs @@ -362,18 +362,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -400,18 +399,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -438,18 +436,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -476,18 +473,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -514,18 +510,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -552,18 +547,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -590,18 +584,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -628,18 +621,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -666,18 +658,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -704,18 +695,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -742,18 +732,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -780,18 +769,17 @@ partial void ProcessGenaiText2stickerResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -825,17 +813,15 @@ partial void ProcessGenaiText2stickerResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -872,17 +858,15 @@ partial void ProcessGenaiText2stickerResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2stickerGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2stickerGetresult.g.cs index 7b20fb3..9fdcd6e 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2stickerGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2stickerGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -617,18 +610,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -655,18 +647,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -693,18 +684,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -731,18 +721,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -769,18 +758,17 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -814,17 +802,15 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -861,17 +847,15 @@ partial void ProcessGenaiText2stickerGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2stickerLaserEngraving.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2stickerLaserEngraving.g.cs index bfca5ed..b47a30a 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2stickerLaserEngraving.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2ImageClient.GenaiText2stickerLaserEngraving.g.cs @@ -362,18 +362,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -400,18 +399,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -438,18 +436,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -476,18 +473,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -514,18 +510,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -552,18 +547,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -590,18 +584,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -628,18 +621,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -666,18 +658,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -704,18 +695,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -742,18 +732,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -780,18 +769,17 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -825,17 +813,15 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -872,17 +858,15 @@ partial void ProcessGenaiText2stickerLaserEngravingResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2TextClient.GenaiText2textCompletions.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2TextClient.GenaiText2textCompletions.g.cs index 217f518..b65c125 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2TextClient.GenaiText2textCompletions.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2TextClient.GenaiText2textCompletions.g.cs @@ -360,18 +360,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessGenaiText2textCompletionsResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessGenaiText2textCompletionsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessGenaiText2textCompletionsResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiImage2video.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiImage2video.g.cs index 0a9c99e..9607834 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiImage2video.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiImage2video.g.cs @@ -364,18 +364,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -402,18 +401,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -440,18 +438,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -478,18 +475,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -516,18 +512,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -554,18 +549,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -592,18 +586,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -630,18 +623,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -668,18 +660,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -706,18 +697,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -744,18 +734,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -782,18 +771,17 @@ partial void ProcessGenaiImage2videoResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -827,17 +815,15 @@ partial void ProcessGenaiImage2videoResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -874,17 +860,15 @@ partial void ProcessGenaiImage2videoResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiText2video.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiText2video.g.cs index 80706b3..643207c 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiText2video.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiText2video.g.cs @@ -364,18 +364,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -402,18 +401,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -440,18 +438,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -478,18 +475,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -516,18 +512,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -554,18 +549,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -592,18 +586,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -630,18 +623,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -668,18 +660,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -706,18 +697,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -744,18 +734,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -782,18 +771,17 @@ partial void ProcessGenaiText2videoResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -827,17 +815,15 @@ partial void ProcessGenaiText2videoResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -874,17 +860,15 @@ partial void ProcessGenaiText2videoResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiText2videoGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiText2videoGetresult.g.cs index 474059e..3edcd95 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiText2videoGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIText2VideoImage2VideoClient.GenaiText2videoGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -617,18 +610,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -655,18 +647,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -693,18 +684,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -731,18 +721,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -769,18 +758,17 @@ partial void ProcessGenaiText2videoGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -814,17 +802,15 @@ partial void ProcessGenaiText2videoGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -861,17 +847,15 @@ partial void ProcessGenaiText2videoGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.GenAIUtilitiesClient.GenaiCreditsBalance.g.cs b/src/libs/Picsart/Generated/Picsart.GenAIUtilitiesClient.GenaiCreditsBalance.g.cs index cf74968..f0cb1ce 100644 --- a/src/libs/Picsart/Generated/Picsart.GenAIUtilitiesClient.GenaiCreditsBalance.g.cs +++ b/src/libs/Picsart/Generated/Picsart.GenAIUtilitiesClient.GenaiCreditsBalance.g.cs @@ -346,18 +346,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -384,18 +383,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -422,18 +420,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -460,18 +457,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -498,18 +494,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -536,18 +531,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -574,18 +568,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -612,18 +605,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -650,18 +642,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -688,18 +679,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -726,18 +716,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -764,18 +753,17 @@ partial void ProcessGenaiCreditsBalanceResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -809,17 +797,15 @@ partial void ProcessGenaiCreditsBalanceResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -856,17 +842,15 @@ partial void ProcessGenaiCreditsBalanceResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageClassificationClient.ImageCarsClassifier.g.cs b/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageCarsClassifier.g.cs index 0efb59b..e8e9b22 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageCarsClassifier.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageCarsClassifier.g.cs @@ -423,18 +423,17 @@ request.Imagename is null __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -461,18 +460,17 @@ request.Imagename is null __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -499,18 +497,17 @@ request.Imagename is null __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -537,18 +534,17 @@ request.Imagename is null __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -575,18 +571,17 @@ request.Imagename is null __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -613,18 +608,17 @@ request.Imagename is null __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -651,18 +645,17 @@ request.Imagename is null __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -689,18 +682,17 @@ request.Imagename is null __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -727,18 +719,17 @@ request.Imagename is null __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -765,18 +756,17 @@ request.Imagename is null __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -803,18 +793,17 @@ request.Imagename is null __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -841,18 +830,17 @@ request.Imagename is null __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -879,18 +867,17 @@ request.Imagename is null __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -924,17 +911,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -971,17 +956,15 @@ request.Imagename is null { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageClassificationClient.ImageDescriber.g.cs b/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageDescriber.g.cs index cded4cc..76642b9 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageDescriber.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageDescriber.g.cs @@ -421,18 +421,17 @@ request.Imagename is null __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -459,18 +458,17 @@ request.Imagename is null __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -497,18 +495,17 @@ request.Imagename is null __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -535,18 +532,17 @@ request.Imagename is null __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -573,18 +569,17 @@ request.Imagename is null __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -611,18 +606,17 @@ request.Imagename is null __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -649,18 +643,17 @@ request.Imagename is null __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -687,18 +680,17 @@ request.Imagename is null __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -725,18 +717,17 @@ request.Imagename is null __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -763,18 +754,17 @@ request.Imagename is null __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -801,18 +791,17 @@ request.Imagename is null __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -839,18 +828,17 @@ request.Imagename is null __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -877,18 +865,17 @@ request.Imagename is null __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -922,17 +909,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -969,17 +954,15 @@ request.Imagename is null { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageClassificationClient.ImageExtractColors.g.cs b/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageExtractColors.g.cs index 094124c..1828e1b 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageExtractColors.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageExtractColors.g.cs @@ -423,18 +423,17 @@ request.Imagename is null __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -461,18 +460,17 @@ request.Imagename is null __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -499,18 +497,17 @@ request.Imagename is null __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -537,18 +534,17 @@ request.Imagename is null __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -575,18 +571,17 @@ request.Imagename is null __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -613,18 +608,17 @@ request.Imagename is null __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -651,18 +645,17 @@ request.Imagename is null __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -689,18 +682,17 @@ request.Imagename is null __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -727,18 +719,17 @@ request.Imagename is null __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -765,18 +756,17 @@ request.Imagename is null __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -803,18 +793,17 @@ request.Imagename is null __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -841,18 +830,17 @@ request.Imagename is null __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -879,18 +867,17 @@ request.Imagename is null __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -924,17 +911,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -971,17 +956,15 @@ request.Imagename is null { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageClassificationClient.ImageSegmentation.g.cs b/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageSegmentation.g.cs index a976bcc..f7e886d 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageSegmentation.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageSegmentation.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageSegmentationResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageSegmentationResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageSegmentationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageSegmentationResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageClassificationClient.ImageTagging.g.cs b/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageTagging.g.cs index 1f24ebb..c3c0581 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageTagging.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageClassificationClient.ImageTagging.g.cs @@ -421,18 +421,17 @@ request.Imagename is null __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -459,18 +458,17 @@ request.Imagename is null __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -497,18 +495,17 @@ request.Imagename is null __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -535,18 +532,17 @@ request.Imagename is null __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -573,18 +569,17 @@ request.Imagename is null __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -611,18 +606,17 @@ request.Imagename is null __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -649,18 +643,17 @@ request.Imagename is null __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -687,18 +680,17 @@ request.Imagename is null __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -725,18 +717,17 @@ request.Imagename is null __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -763,18 +754,17 @@ request.Imagename is null __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -801,18 +791,17 @@ request.Imagename is null __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -839,18 +828,17 @@ request.Imagename is null __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -877,18 +865,17 @@ request.Imagename is null __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -922,17 +909,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -969,17 +954,15 @@ request.Imagename is null { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageContentGenerationClient.ImageGeneratePattern.g.cs b/src/libs/Picsart/Generated/Picsart.ImageContentGenerationClient.ImageGeneratePattern.g.cs index cf6188b..1796ed1 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageContentGenerationClient.ImageGeneratePattern.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageContentGenerationClient.ImageGeneratePattern.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageGeneratePatternResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageGeneratePatternResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageGeneratePatternResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageGeneratePatternResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageConversionClient.ImageDesignImport.g.cs b/src/libs/Picsart/Generated/Picsart.ImageConversionClient.ImageDesignImport.g.cs index 7afde0a..192bc38 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageConversionClient.ImageDesignImport.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageConversionClient.ImageDesignImport.g.cs @@ -421,18 +421,17 @@ request.Filename is null __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -459,18 +458,17 @@ request.Filename is null __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -497,18 +495,17 @@ request.Filename is null __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -535,18 +532,17 @@ request.Filename is null __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -573,18 +569,17 @@ request.Filename is null __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -611,18 +606,17 @@ request.Filename is null __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -649,18 +643,17 @@ request.Filename is null __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -687,18 +680,17 @@ request.Filename is null __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -725,18 +717,17 @@ request.Filename is null __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -763,18 +754,17 @@ request.Filename is null __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -801,18 +791,17 @@ request.Filename is null __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -839,18 +828,17 @@ request.Filename is null __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -877,18 +865,17 @@ request.Filename is null __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -922,17 +909,15 @@ request.Filename is null } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -969,17 +954,15 @@ request.Filename is null { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageConversionClient.ImageDesignImportGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.ImageConversionClient.ImageDesignImportGetresult.g.cs index 677a5b2..a90a79c 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageConversionClient.ImageDesignImportGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageConversionClient.ImageDesignImportGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -617,18 +610,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -655,18 +647,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -693,18 +684,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -731,18 +721,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -769,18 +758,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -807,18 +795,17 @@ partial void ProcessImageDesignImportGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -852,17 +839,15 @@ partial void ProcessImageDesignImportGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -899,17 +884,15 @@ partial void ProcessImageDesignImportGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageConversionClient.ImageVectorizeRasterToSvg.g.cs b/src/libs/Picsart/Generated/Picsart.ImageConversionClient.ImageVectorizeRasterToSvg.g.cs index 20d9023..5c724cb 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageConversionClient.ImageVectorizeRasterToSvg.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageConversionClient.ImageVectorizeRasterToSvg.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageVectorizeRasterToSvgResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageVectorizeRasterToSvgResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEditingClient.ImageBlend.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageBlend.g.cs index ca61484..ef1a03a 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageBlend.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageBlend.g.cs @@ -363,18 +363,17 @@ partial void ProcessImageBlendResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -401,18 +400,17 @@ partial void ProcessImageBlendResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -439,18 +437,17 @@ partial void ProcessImageBlendResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -477,18 +474,17 @@ partial void ProcessImageBlendResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -515,18 +511,17 @@ partial void ProcessImageBlendResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -553,18 +548,17 @@ partial void ProcessImageBlendResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -591,18 +585,17 @@ partial void ProcessImageBlendResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -629,18 +622,17 @@ partial void ProcessImageBlendResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -667,18 +659,17 @@ partial void ProcessImageBlendResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -705,18 +696,17 @@ partial void ProcessImageBlendResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -743,18 +733,17 @@ partial void ProcessImageBlendResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -781,18 +770,17 @@ partial void ProcessImageBlendResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -819,18 +807,17 @@ partial void ProcessImageBlendResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -864,17 +851,15 @@ partial void ProcessImageBlendResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -911,17 +896,15 @@ partial void ProcessImageBlendResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEditingClient.ImageEdit.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageEdit.g.cs index ff7b332..34905bd 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageEdit.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageEdit.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageEditResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageEditResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageEditResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageEditResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageEditResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageEditResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageEditResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageEditResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageEditResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageEditResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageEditResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageEditResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageEditResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageEditResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageEditResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEditingClient.ImageSmartCrop.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageSmartCrop.g.cs index a5058ea..7bad31a 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageSmartCrop.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageSmartCrop.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Payment Required if ((int)__response.StatusCode == 402) @@ -397,18 +396,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -435,18 +433,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageSmartCropResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageSmartCropResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageSmartCropResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEditingClient.ImageZoom.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageZoom.g.cs index 2827049..ba23a5a 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageZoom.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEditingClient.ImageZoom.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageZoomResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Payment Required if ((int)__response.StatusCode == 402) @@ -397,18 +396,17 @@ partial void ProcessImageZoomResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -435,18 +433,17 @@ partial void ProcessImageZoomResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageZoomResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageZoomResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageZoomResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageZoomResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageZoomResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageZoomResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageZoomResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageZoomResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageZoomResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageZoomResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageZoomResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageZoomResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageAdjust.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageAdjust.g.cs index 6237d2b..b038bd3 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageAdjust.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageAdjust.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageAdjustResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Payment Required if ((int)__response.StatusCode == 402) @@ -397,18 +396,17 @@ partial void ProcessImageAdjustResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -435,18 +433,17 @@ partial void ProcessImageAdjustResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageAdjustResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageAdjustResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageAdjustResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageAdjustResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageAdjustResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageAdjustResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageAdjustResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageAdjustResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageAdjustResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageAdjustResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageAdjustResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageAdjustResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyAiEffect.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyAiEffect.g.cs index 11c5c07..e326a42 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyAiEffect.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyAiEffect.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageApplyAiEffectResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageApplyAiEffectResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageApplyAiEffectResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageApplyAiEffectResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyEffect.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyEffect.g.cs index e69abc5..9276314 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyEffect.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyEffect.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageApplyEffectResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageApplyEffectResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageApplyEffectResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageApplyEffectResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyLaserEngravingEffect.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyLaserEngravingEffect.g.cs index e4755fd..461aec0 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyLaserEngravingEffect.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyLaserEngravingEffect.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageApplyLaserEngravingEffectResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageApplyLaserEngravingEffectResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyMask.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyMask.g.cs index e4e2e61..b978f35 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyMask.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageApplyMask.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageApplyMaskResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageApplyMaskResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageApplyMaskResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageApplyMaskResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageCreateEffectPreviews.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageCreateEffectPreviews.g.cs index a2191ad..57f650e 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageCreateEffectPreviews.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageCreateEffectPreviews.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageCreateEffectPreviewsResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageCreateEffectPreviewsResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageCreateMaskPreviews.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageCreateMaskPreviews.g.cs index ceeebf5..54f5012 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageCreateMaskPreviews.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageCreateMaskPreviews.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageCreateMaskPreviewsResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageCreateMaskPreviewsResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageListAiEffectNames.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageListAiEffectNames.g.cs index e5adb57..ddc0bc0 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageListAiEffectNames.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageListAiEffectNames.g.cs @@ -342,18 +342,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -380,18 +379,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -418,18 +416,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -456,18 +453,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -494,18 +490,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -532,18 +527,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -570,18 +564,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -608,18 +601,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -646,18 +638,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -684,18 +675,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -722,18 +712,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -760,18 +749,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -798,18 +786,17 @@ partial void ProcessImageListAiEffectNamesResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -843,17 +830,15 @@ partial void ProcessImageListAiEffectNamesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -890,17 +875,15 @@ partial void ProcessImageListAiEffectNamesResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageListEffectNames.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageListEffectNames.g.cs index d677507..17be716 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageListEffectNames.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageListEffectNames.g.cs @@ -342,18 +342,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -380,18 +379,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -418,18 +416,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -456,18 +453,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -494,18 +490,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -532,18 +527,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -570,18 +564,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -608,18 +601,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -646,18 +638,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -684,18 +675,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -722,18 +712,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -760,18 +749,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -798,18 +786,17 @@ partial void ProcessImageListEffectNamesResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -843,17 +830,15 @@ partial void ProcessImageListEffectNamesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -890,17 +875,15 @@ partial void ProcessImageListEffectNamesResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageSelectiveBlur.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageSelectiveBlur.g.cs index e541806..bfa3a79 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageSelectiveBlur.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageSelectiveBlur.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Payment Required if ((int)__response.StatusCode == 402) @@ -397,18 +396,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -435,18 +433,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageSelectiveBlurResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageSelectiveBlurResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageSelectiveBlurResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageTransferColor.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageTransferColor.g.cs index b11240f..46e163f 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageTransferColor.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageTransferColor.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageTransferColorResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageTransferColorResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageTransferColorResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageTransferColorResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageEffectsClient.ImageTransferStyle.g.cs b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageTransferStyle.g.cs index 8d41b34..80fa321 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageTransferStyle.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageEffectsClient.ImageTransferStyle.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageTransferStyleResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageTransferStyleResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageTransferStyleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageTransferStyleResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageFaceEnhance.g.cs b/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageFaceEnhance.g.cs index 3e0a459..53b3c98 100644 --- a/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageFaceEnhance.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageFaceEnhance.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageFaceEnhanceResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageFaceEnhanceResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageFaceEnhanceResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageFaceEnhanceResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraEnhance.g.cs b/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraEnhance.g.cs index 3844a62..5022666 100644 --- a/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraEnhance.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraEnhance.g.cs @@ -381,18 +381,17 @@ partial void ProcessImageUltraEnhanceResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageUltraEnhanceResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageUltraEnhanceResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageUltraEnhanceResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -533,18 +529,17 @@ partial void ProcessImageUltraEnhanceResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -571,18 +566,17 @@ partial void ProcessImageUltraEnhanceResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -609,18 +603,17 @@ partial void ProcessImageUltraEnhanceResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -647,18 +640,17 @@ partial void ProcessImageUltraEnhanceResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -685,18 +677,17 @@ partial void ProcessImageUltraEnhanceResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -723,18 +714,17 @@ partial void ProcessImageUltraEnhanceResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -761,18 +751,17 @@ partial void ProcessImageUltraEnhanceResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -799,18 +788,17 @@ partial void ProcessImageUltraEnhanceResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -837,18 +825,17 @@ partial void ProcessImageUltraEnhanceResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -882,17 +869,15 @@ partial void ProcessImageUltraEnhanceResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -929,17 +914,15 @@ partial void ProcessImageUltraEnhanceResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraUpscale.g.cs b/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraUpscale.g.cs index 2659b34..33a13af 100644 --- a/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraUpscale.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraUpscale.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageUltraUpscaleResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageUltraUpscaleResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageUltraUpscaleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageUltraUpscaleResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraUpscaleGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraUpscaleGetresult.g.cs index 9122e36..a7c128b 100644 --- a/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraUpscaleGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUltraUpscaleGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -617,18 +610,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -655,18 +647,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -693,18 +684,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -731,18 +721,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -769,18 +758,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -807,18 +795,17 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -852,17 +839,15 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -899,17 +884,15 @@ partial void ProcessImageUltraUpscaleGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUpscale.g.cs b/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUpscale.g.cs index 164caa7..d5c53e7 100644 --- a/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUpscale.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImagePhotoEnhancementClient.ImageUpscale.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageUpscaleResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageUpscaleResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageUpscaleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageUpscaleResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageRemoveBackgroundClient.ImageRemoveBackground.g.cs b/src/libs/Picsart/Generated/Picsart.ImageRemoveBackgroundClient.ImageRemoveBackground.g.cs index f1d6ed1..59504df 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageRemoveBackgroundClient.ImageRemoveBackground.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageRemoveBackgroundClient.ImageRemoveBackground.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageRemoveBackgroundResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageRemoveBackgroundResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageRemoveBackgroundResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageRemoveBackgroundResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageSurfacemapClient.ImageSurfacemap.g.cs b/src/libs/Picsart/Generated/Picsart.ImageSurfacemapClient.ImageSurfacemap.g.cs index 0653589..c349da1 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageSurfacemapClient.ImageSurfacemap.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageSurfacemapClient.ImageSurfacemap.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageSurfacemapResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessImageSurfacemapResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessImageSurfacemapResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessImageSurfacemapResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageUtilitiesClient.ImageCreditsBalance.g.cs b/src/libs/Picsart/Generated/Picsart.ImageUtilitiesClient.ImageCreditsBalance.g.cs index afc2a56..6df5cbd 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageUtilitiesClient.ImageCreditsBalance.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageUtilitiesClient.ImageCreditsBalance.g.cs @@ -342,18 +342,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -380,18 +379,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -418,18 +416,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -456,18 +453,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -494,18 +490,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -532,18 +527,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -570,18 +564,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -608,18 +601,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -646,18 +638,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -684,18 +675,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -722,18 +712,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -760,18 +749,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -798,18 +786,17 @@ partial void ProcessImageCreditsBalanceResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -843,17 +830,15 @@ partial void ProcessImageCreditsBalanceResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -890,17 +875,15 @@ partial void ProcessImageCreditsBalanceResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageUtilitiesClient.ImageUpload.g.cs b/src/libs/Picsart/Generated/Picsart.ImageUtilitiesClient.ImageUpload.g.cs index af7dbba..044690d 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageUtilitiesClient.ImageUpload.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageUtilitiesClient.ImageUpload.g.cs @@ -421,18 +421,17 @@ request.Imagename is null __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -459,18 +458,17 @@ request.Imagename is null __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -497,18 +495,17 @@ request.Imagename is null __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -535,18 +532,17 @@ request.Imagename is null __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -573,18 +569,17 @@ request.Imagename is null __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -611,18 +606,17 @@ request.Imagename is null __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -649,18 +643,17 @@ request.Imagename is null __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -687,18 +680,17 @@ request.Imagename is null __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -725,18 +717,17 @@ request.Imagename is null __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -763,18 +754,17 @@ request.Imagename is null __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -801,18 +791,17 @@ request.Imagename is null __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -839,18 +828,17 @@ request.Imagename is null __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -877,18 +865,17 @@ request.Imagename is null __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -922,17 +909,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -969,17 +954,15 @@ request.Imagename is null { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.ImageWatermarkClient.ImageAddWatermark.g.cs b/src/libs/Picsart/Generated/Picsart.ImageWatermarkClient.ImageAddWatermark.g.cs index 524363c..d722995 100644 --- a/src/libs/Picsart/Generated/Picsart.ImageWatermarkClient.ImageAddWatermark.g.cs +++ b/src/libs/Picsart/Generated/Picsart.ImageWatermarkClient.ImageAddWatermark.g.cs @@ -359,18 +359,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessImageAddWatermarkResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -663,18 +655,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -701,18 +692,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -739,18 +729,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -777,18 +766,17 @@ partial void ProcessImageAddWatermarkResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -822,17 +810,15 @@ partial void ProcessImageAddWatermarkResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -869,17 +855,15 @@ partial void ProcessImageAddWatermarkResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VdReplayClient.VdExportReplay.g.cs b/src/libs/Picsart/Generated/Picsart.VdReplayClient.VdExportReplay.g.cs index 5036ae2..e438414 100644 --- a/src/libs/Picsart/Generated/Picsart.VdReplayClient.VdExportReplay.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VdReplayClient.VdExportReplay.g.cs @@ -359,18 +359,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessVdExportReplayResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -663,18 +655,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -701,18 +692,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -739,18 +729,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -777,18 +766,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -815,18 +803,17 @@ partial void ProcessVdExportReplayResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -860,17 +847,15 @@ partial void ProcessVdExportReplayResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -907,17 +892,15 @@ partial void ProcessVdExportReplayResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VdReplayClient.VdExportReplayGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.VdReplayClient.VdExportReplayGetresult.g.cs index f80aef1..2756d25 100644 --- a/src/libs/Picsart/Generated/Picsart.VdReplayClient.VdExportReplayGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VdReplayClient.VdExportReplayGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -617,18 +610,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -655,18 +647,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -693,18 +684,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -731,18 +721,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -769,18 +758,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -807,18 +795,17 @@ partial void ProcessVdExportReplayGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -852,17 +839,15 @@ partial void ProcessVdExportReplayGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -899,17 +884,15 @@ partial void ProcessVdExportReplayGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VdUtilitiesClient.VdCreditsBalance.g.cs b/src/libs/Picsart/Generated/Picsart.VdUtilitiesClient.VdCreditsBalance.g.cs index e78ce3a..d204ec0 100644 --- a/src/libs/Picsart/Generated/Picsart.VdUtilitiesClient.VdCreditsBalance.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VdUtilitiesClient.VdCreditsBalance.g.cs @@ -342,18 +342,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -380,18 +379,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -418,18 +416,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -456,18 +453,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -494,18 +490,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -532,18 +527,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -570,18 +564,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -608,18 +601,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -646,18 +638,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -684,18 +675,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -722,18 +712,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -760,18 +749,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -798,18 +786,17 @@ partial void ProcessVdCreditsBalanceResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -843,17 +830,15 @@ partial void ProcessVdCreditsBalanceResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -890,17 +875,15 @@ partial void ProcessVdCreditsBalanceResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VdVariableDataContentClient.VdDescribeVariableDataContent.g.cs b/src/libs/Picsart/Generated/Picsart.VdVariableDataContentClient.VdDescribeVariableDataContent.g.cs index 621e240..fdff08b 100644 --- a/src/libs/Picsart/Generated/Picsart.VdVariableDataContentClient.VdDescribeVariableDataContent.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VdVariableDataContentClient.VdDescribeVariableDataContent.g.cs @@ -419,18 +419,17 @@ request.Templatename is null __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -457,18 +456,17 @@ request.Templatename is null __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -495,18 +493,17 @@ request.Templatename is null __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -533,18 +530,17 @@ request.Templatename is null __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -571,18 +567,17 @@ request.Templatename is null __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -609,18 +604,17 @@ request.Templatename is null __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -647,18 +641,17 @@ request.Templatename is null __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -685,18 +678,17 @@ request.Templatename is null __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -723,18 +715,17 @@ request.Templatename is null __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -761,18 +752,17 @@ request.Templatename is null __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -799,18 +789,17 @@ request.Templatename is null __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -837,18 +826,17 @@ request.Templatename is null __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -875,18 +863,17 @@ request.Templatename is null __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -920,17 +907,15 @@ request.Templatename is null } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -967,17 +952,15 @@ request.Templatename is null { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VdVariableDataContentClient.VdExportVariableDataContent.g.cs b/src/libs/Picsart/Generated/Picsart.VdVariableDataContentClient.VdExportVariableDataContent.g.cs index 14b0b76..d2bd070 100644 --- a/src/libs/Picsart/Generated/Picsart.VdVariableDataContentClient.VdExportVariableDataContent.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VdVariableDataContentClient.VdExportVariableDataContent.g.cs @@ -361,18 +361,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -399,18 +398,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -437,18 +435,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -475,18 +472,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -513,18 +509,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -551,18 +546,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -589,18 +583,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -627,18 +620,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -665,18 +657,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -703,18 +694,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -741,18 +731,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -779,18 +768,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -817,18 +805,17 @@ partial void ProcessVdExportVariableDataContentResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -862,17 +849,15 @@ partial void ProcessVdExportVariableDataContentResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -909,17 +894,15 @@ partial void ProcessVdExportVariableDataContentResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VdVariableDataContentClient.VdExportVariableDataContentGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.VdVariableDataContentClient.VdExportVariableDataContentGetresult.g.cs index 574e85a..579123e 100644 --- a/src/libs/Picsart/Generated/Picsart.VdVariableDataContentClient.VdExportVariableDataContentGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VdVariableDataContentClient.VdExportVariableDataContentGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -617,18 +610,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -655,18 +647,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -693,18 +684,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -731,18 +721,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -769,18 +758,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -807,18 +795,17 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -852,17 +839,15 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -899,17 +884,15 @@ partial void ProcessVdExportVariableDataContentGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoAdsClient.VideoEncodeCtv.g.cs b/src/libs/Picsart/Generated/Picsart.VideoAdsClient.VideoEncodeCtv.g.cs index 206c137..1f36e14 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoAdsClient.VideoEncodeCtv.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoAdsClient.VideoEncodeCtv.g.cs @@ -362,18 +362,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -400,18 +399,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -438,18 +436,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -476,18 +473,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -514,18 +510,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -552,18 +547,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -590,18 +584,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -628,18 +621,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -666,18 +658,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -704,18 +695,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -742,18 +732,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -780,18 +769,17 @@ partial void ProcessVideoEncodeCtvResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -825,17 +813,15 @@ partial void ProcessVideoEncodeCtvResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -872,17 +858,15 @@ partial void ProcessVideoEncodeCtvResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoAudioClient.VideoAdjustAudio.g.cs b/src/libs/Picsart/Generated/Picsart.VideoAudioClient.VideoAdjustAudio.g.cs index aaac240..13e95b7 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoAudioClient.VideoAdjustAudio.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoAudioClient.VideoAdjustAudio.g.cs @@ -360,18 +360,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessVideoAdjustAudioResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessVideoAdjustAudioResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessVideoAdjustAudioResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoAudioClient.VideoExtractAudio.g.cs b/src/libs/Picsart/Generated/Picsart.VideoAudioClient.VideoExtractAudio.g.cs index 671806b..dab24ad 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoAudioClient.VideoExtractAudio.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoAudioClient.VideoExtractAudio.g.cs @@ -360,18 +360,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessVideoExtractAudioResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessVideoExtractAudioResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessVideoExtractAudioResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoEditClient.VideoConcat.g.cs b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoConcat.g.cs index 330647b..1bb7fa9 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoConcat.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoConcat.g.cs @@ -360,18 +360,17 @@ partial void ProcessVideoConcatResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessVideoConcatResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessVideoConcatResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessVideoConcatResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessVideoConcatResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessVideoConcatResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessVideoConcatResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessVideoConcatResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessVideoConcatResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessVideoConcatResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessVideoConcatResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessVideoConcatResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessVideoConcatResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessVideoConcatResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoEditClient.VideoConcatHighlights.g.cs b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoConcatHighlights.g.cs index 78d0241..54ff9d1 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoConcatHighlights.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoConcatHighlights.g.cs @@ -358,18 +358,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -396,18 +395,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -434,18 +432,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -472,18 +469,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -510,18 +506,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -548,18 +543,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -586,18 +580,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -624,18 +617,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -662,18 +654,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -700,18 +691,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -738,18 +728,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -776,18 +765,17 @@ partial void ProcessVideoConcatHighlightsResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -821,17 +809,15 @@ partial void ProcessVideoConcatHighlightsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -868,17 +854,15 @@ partial void ProcessVideoConcatHighlightsResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoEditClient.VideoCrop.g.cs b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoCrop.g.cs index 1964d03..4587583 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoCrop.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoCrop.g.cs @@ -360,18 +360,17 @@ partial void ProcessVideoCropResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessVideoCropResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessVideoCropResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessVideoCropResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessVideoCropResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessVideoCropResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessVideoCropResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessVideoCropResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessVideoCropResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessVideoCropResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessVideoCropResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessVideoCropResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessVideoCropResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessVideoCropResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoEditClient.VideoEdit.g.cs b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoEdit.g.cs index acc9306..e114b8f 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoEdit.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoEdit.g.cs @@ -360,18 +360,17 @@ partial void ProcessVideoEditResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessVideoEditResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessVideoEditResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessVideoEditResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessVideoEditResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessVideoEditResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessVideoEditResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessVideoEditResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessVideoEditResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessVideoEditResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessVideoEditResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessVideoEditResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessVideoEditResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessVideoEditResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoEditClient.VideoFit.g.cs b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoFit.g.cs index d747acf..1762f9c 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoFit.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoFit.g.cs @@ -360,18 +360,17 @@ partial void ProcessVideoFitResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessVideoFitResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessVideoFitResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessVideoFitResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessVideoFitResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessVideoFitResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessVideoFitResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessVideoFitResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessVideoFitResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessVideoFitResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessVideoFitResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessVideoFitResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessVideoFitResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessVideoFitResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoEditClient.VideoTrim.g.cs b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoTrim.g.cs index 0d9cedf..c042f14 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoTrim.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoEditClient.VideoTrim.g.cs @@ -360,18 +360,17 @@ partial void ProcessVideoTrimResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessVideoTrimResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessVideoTrimResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessVideoTrimResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessVideoTrimResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessVideoTrimResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessVideoTrimResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessVideoTrimResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessVideoTrimResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessVideoTrimResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessVideoTrimResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessVideoTrimResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessVideoTrimResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessVideoTrimResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoEffectsClient.VideoAdjust.g.cs b/src/libs/Picsart/Generated/Picsart.VideoEffectsClient.VideoAdjust.g.cs index f6c0091..7c3d053 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoEffectsClient.VideoAdjust.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoEffectsClient.VideoAdjust.g.cs @@ -382,18 +382,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -420,18 +419,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -458,18 +456,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -496,18 +493,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -534,18 +530,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -572,18 +567,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -610,18 +604,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -648,18 +641,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -686,18 +678,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -724,18 +715,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -762,18 +752,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -800,18 +789,17 @@ partial void ProcessVideoAdjustResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -845,17 +833,15 @@ partial void ProcessVideoAdjustResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -892,17 +878,15 @@ partial void ProcessVideoAdjustResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoEffectsClient.VideoApplyEffect.g.cs b/src/libs/Picsart/Generated/Picsart.VideoEffectsClient.VideoApplyEffect.g.cs index 50262cd..0cc0a79 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoEffectsClient.VideoApplyEffect.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoEffectsClient.VideoApplyEffect.g.cs @@ -360,18 +360,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessVideoApplyEffectResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessVideoApplyEffectResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessVideoApplyEffectResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoMetadataClient.VideoGetThumbnail.g.cs b/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoGetThumbnail.g.cs index 9b8dfae..e7e6cac 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoGetThumbnail.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoGetThumbnail.g.cs @@ -360,18 +360,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessVideoGetThumbnailResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessVideoGetThumbnailResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessVideoGetThumbnailResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoMetadataClient.VideoMetadata.g.cs b/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoMetadata.g.cs index 33873bd..4839f9c 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoMetadata.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoMetadata.g.cs @@ -362,18 +362,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -400,18 +399,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -438,18 +436,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -476,18 +473,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -514,18 +510,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -552,18 +547,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -590,18 +584,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -628,18 +621,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -666,18 +658,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -704,18 +695,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -742,18 +732,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -780,18 +769,17 @@ partial void ProcessVideoMetadataResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -825,17 +813,15 @@ partial void ProcessVideoMetadataResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -872,17 +858,15 @@ partial void ProcessVideoMetadataResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoMetadataClient.VideoSetThumbnail.g.cs b/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoSetThumbnail.g.cs index 0271981..38da643 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoSetThumbnail.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoSetThumbnail.g.cs @@ -360,18 +360,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -398,18 +397,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -436,18 +434,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -474,18 +471,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +508,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -550,18 +545,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -588,18 +582,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -626,18 +619,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -664,18 +656,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -702,18 +693,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -740,18 +730,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -778,18 +767,17 @@ partial void ProcessVideoSetThumbnailResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -823,17 +811,15 @@ partial void ProcessVideoSetThumbnailResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -870,17 +856,15 @@ partial void ProcessVideoSetThumbnailResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoMetadataClient.VideoSetThumbnailGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoSetThumbnailGetresult.g.cs index 25508f5..40fa613 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoSetThumbnailGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoMetadataClient.VideoSetThumbnailGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -617,18 +610,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -655,18 +647,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -693,18 +684,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -731,18 +721,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -769,18 +758,17 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -814,17 +802,15 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -861,17 +847,15 @@ partial void ProcessVideoSetThumbnailGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoRemoveBackgroundClient.VideoRemoveBackground.g.cs b/src/libs/Picsart/Generated/Picsart.VideoRemoveBackgroundClient.VideoRemoveBackground.g.cs index b80d2a4..326ddb8 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoRemoveBackgroundClient.VideoRemoveBackground.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoRemoveBackgroundClient.VideoRemoveBackground.g.cs @@ -359,18 +359,17 @@ partial void ProcessVideoRemoveBackgroundResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessVideoRemoveBackgroundResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessVideoRemoveBackgroundResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -473,18 +470,17 @@ partial void ProcessVideoRemoveBackgroundResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -511,18 +507,17 @@ partial void ProcessVideoRemoveBackgroundResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -549,18 +544,17 @@ partial void ProcessVideoRemoveBackgroundResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -587,18 +581,17 @@ partial void ProcessVideoRemoveBackgroundResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -625,18 +618,17 @@ partial void ProcessVideoRemoveBackgroundResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -663,18 +655,17 @@ partial void ProcessVideoRemoveBackgroundResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -701,18 +692,17 @@ partial void ProcessVideoRemoveBackgroundResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -739,18 +729,17 @@ partial void ProcessVideoRemoveBackgroundResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -784,17 +773,15 @@ partial void ProcessVideoRemoveBackgroundResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -831,17 +818,15 @@ partial void ProcessVideoRemoveBackgroundResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoTranscriptionsClient.VideoTranscribeAudio.g.cs b/src/libs/Picsart/Generated/Picsart.VideoTranscriptionsClient.VideoTranscribeAudio.g.cs index 69590fe..5fde2ef 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoTranscriptionsClient.VideoTranscribeAudio.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoTranscriptionsClient.VideoTranscribeAudio.g.cs @@ -378,18 +378,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -416,18 +415,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -454,18 +452,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -492,18 +489,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -530,18 +526,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -568,18 +563,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -606,18 +600,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -644,18 +637,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -682,18 +674,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -720,18 +711,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -758,18 +748,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -796,18 +785,17 @@ partial void ProcessVideoTranscribeAudioResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -841,17 +829,15 @@ partial void ProcessVideoTranscribeAudioResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -888,17 +874,15 @@ partial void ProcessVideoTranscribeAudioResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoTranscriptionsClient.VideoTranscribeAudioGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.VideoTranscriptionsClient.VideoTranscribeAudioGetresult.g.cs index 6b60d53..ff027ec 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoTranscriptionsClient.VideoTranscribeAudioGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoTranscriptionsClient.VideoTranscribeAudioGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -617,18 +610,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -655,18 +647,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -693,18 +684,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -731,18 +721,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -769,18 +758,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -807,18 +795,17 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -852,17 +839,15 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -899,17 +884,15 @@ partial void ProcessVideoTranscribeAudioGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoCreditsBalance.g.cs b/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoCreditsBalance.g.cs index 95636eb..8e4efb4 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoCreditsBalance.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoCreditsBalance.g.cs @@ -342,18 +342,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -380,18 +379,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -418,18 +416,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -456,18 +453,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -494,18 +490,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -532,18 +527,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -570,18 +564,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -608,18 +601,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -646,18 +638,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -684,18 +675,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -722,18 +712,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -760,18 +749,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -798,18 +786,17 @@ partial void ProcessVideoCreditsBalanceResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -843,17 +830,15 @@ partial void ProcessVideoCreditsBalanceResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -890,17 +875,15 @@ partial void ProcessVideoCreditsBalanceResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoGetaudioresult.g.cs b/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoGetaudioresult.g.cs index b851edd..3df2015 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoGetaudioresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoGetaudioresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -465,18 +462,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -503,18 +499,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -541,18 +536,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -579,18 +573,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -617,18 +610,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -655,18 +647,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -693,18 +684,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -731,18 +721,17 @@ partial void ProcessVideoGetaudioresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -776,17 +765,15 @@ partial void ProcessVideoGetaudioresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -823,17 +810,15 @@ partial void ProcessVideoGetaudioresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoGetresult.g.cs index 3401741..e251607 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -465,18 +462,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -503,18 +499,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -541,18 +536,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -579,18 +573,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -617,18 +610,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -655,18 +647,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -693,18 +684,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -731,18 +721,17 @@ partial void ProcessVideoGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -776,17 +765,15 @@ partial void ProcessVideoGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -823,17 +810,15 @@ partial void ProcessVideoGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoUpload.g.cs b/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoUpload.g.cs index c0ffaa3..9d0f16f 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoUpload.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoUtilitiesClient.VideoUpload.g.cs @@ -403,18 +403,17 @@ request.Filename is null __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -441,18 +440,17 @@ request.Filename is null __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -479,18 +477,17 @@ request.Filename is null __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -517,18 +514,17 @@ request.Filename is null __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -555,18 +551,17 @@ request.Filename is null __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -593,18 +588,17 @@ request.Filename is null __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -631,18 +625,17 @@ request.Filename is null __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -669,18 +662,17 @@ request.Filename is null __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -707,18 +699,17 @@ request.Filename is null __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -745,18 +736,17 @@ request.Filename is null __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -783,18 +773,17 @@ request.Filename is null __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -828,17 +817,15 @@ request.Filename is null } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -875,17 +862,15 @@ request.Filename is null { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoVideoEnhancementClient.VideoUpscaleFps.g.cs b/src/libs/Picsart/Generated/Picsart.VideoVideoEnhancementClient.VideoUpscaleFps.g.cs index 08cfe7c..484353f 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoVideoEnhancementClient.VideoUpscaleFps.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoVideoEnhancementClient.VideoUpscaleFps.g.cs @@ -369,18 +369,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -407,18 +406,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -445,18 +443,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -483,18 +480,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -521,18 +517,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -559,18 +554,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -597,18 +591,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -635,18 +628,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -673,18 +665,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_422 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -711,18 +702,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -749,18 +739,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -787,18 +776,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -825,18 +813,17 @@ partial void ProcessVideoUpscaleFpsResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -870,17 +857,15 @@ partial void ProcessVideoUpscaleFpsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -917,17 +902,15 @@ partial void ProcessVideoUpscaleFpsResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoVideoEnhancementClient.VideoUpscaleFpsGetresult.g.cs b/src/libs/Picsart/Generated/Picsart.VideoVideoEnhancementClient.VideoUpscaleFpsGetresult.g.cs index f44961e..2785cd5 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoVideoEnhancementClient.VideoUpscaleFpsGetresult.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoVideoEnhancementClient.VideoUpscaleFpsGetresult.g.cs @@ -351,18 +351,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -389,18 +388,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -427,18 +425,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -465,18 +462,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -503,18 +499,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -541,18 +536,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -579,18 +573,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -617,18 +610,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -655,18 +647,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -693,18 +684,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -731,18 +721,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -769,18 +758,17 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -814,17 +802,15 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -861,17 +847,15 @@ partial void ProcessVideoUpscaleFpsGetresultResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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/Picsart/Generated/Picsart.VideoWatermarkClient.VideoAddWatermark.g.cs b/src/libs/Picsart/Generated/Picsart.VideoWatermarkClient.VideoAddWatermark.g.cs index 71a6ffc..265b525 100644 --- a/src/libs/Picsart/Generated/Picsart.VideoWatermarkClient.VideoAddWatermark.g.cs +++ b/src/libs/Picsart/Generated/Picsart.VideoWatermarkClient.VideoAddWatermark.g.cs @@ -359,18 +359,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_400 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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 ProcessVideoAddWatermarkResponseContent( __exception_401 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -435,18 +433,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_402 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -473,18 +470,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_403 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -511,18 +507,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_404 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Method Not Allowed if ((int)__response.StatusCode == 405) @@ -549,18 +544,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_405 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_405 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_405, - statusCode: __response.StatusCode) - { - ResponseBody = __content_405, - ResponseObject = __value_405, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_405, + responseObject: __value_405, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Request Entity Too Large if ((int)__response.StatusCode == 413) @@ -587,18 +581,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_413 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Unsupported Media Type if ((int)__response.StatusCode == 415) @@ -625,18 +618,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_415 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Too Many Requests if ((int)__response.StatusCode == 429) @@ -663,18 +655,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_429 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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)); } // Request Header Fields Too Large if ((int)__response.StatusCode == 431) @@ -701,18 +692,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_431 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.ApiException.Create( + statusCode: __response.StatusCode, message: __content_431 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_431, - statusCode: __response.StatusCode) - { - ResponseBody = __content_431, - ResponseObject = __value_431, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_431, + responseObject: __value_431, + 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) @@ -739,18 +729,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_500 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -777,18 +766,17 @@ partial void ProcessVideoAddWatermarkResponseContent( __exception_503 = __ex; } - throw new global::Picsart.ApiException( + + throw global::Picsart.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) @@ -822,17 +810,15 @@ partial void ProcessVideoAddWatermarkResponseContent( } catch (global::System.Exception __ex) { - throw new global::Picsart.ApiException( + throw global::Picsart.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 @@ -869,17 +855,15 @@ partial void ProcessVideoAddWatermarkResponseContent( { } - throw new global::Picsart.ApiException( + throw global::Picsart.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)); } }