diff --git a/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AiVoiceClonerCreateAudio.g.cs b/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AiVoiceClonerCreateAudio.g.cs index 3165f9c..7ac4531 100644 --- a/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AiVoiceClonerCreateAudio.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AiVoiceClonerCreateAudio.g.cs @@ -402,18 +402,17 @@ partial void ProcessAiVoiceClonerCreateAudioResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -440,18 +439,17 @@ partial void ProcessAiVoiceClonerCreateAudioResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -478,18 +476,17 @@ partial void ProcessAiVoiceClonerCreateAudioResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -516,18 +513,17 @@ partial void ProcessAiVoiceClonerCreateAudioResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -554,18 +550,17 @@ partial void ProcessAiVoiceClonerCreateAudioResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -599,17 +594,15 @@ partial void ProcessAiVoiceClonerCreateAudioResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -646,17 +639,15 @@ partial void ProcessAiVoiceClonerCreateAudioResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.AudioProjectsClient.AiVoiceGeneratorCreateAudio.g.cs b/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AiVoiceGeneratorCreateAudio.g.cs index 2c9a531..b18c533 100644 --- a/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AiVoiceGeneratorCreateAudio.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AiVoiceGeneratorCreateAudio.g.cs @@ -394,18 +394,17 @@ partial void ProcessAiVoiceGeneratorCreateAudioResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -432,18 +431,17 @@ partial void ProcessAiVoiceGeneratorCreateAudioResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -470,18 +468,17 @@ partial void ProcessAiVoiceGeneratorCreateAudioResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -508,18 +505,17 @@ partial void ProcessAiVoiceGeneratorCreateAudioResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -546,18 +542,17 @@ partial void ProcessAiVoiceGeneratorCreateAudioResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -591,17 +586,15 @@ partial void ProcessAiVoiceGeneratorCreateAudioResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -638,17 +631,15 @@ partial void ProcessAiVoiceGeneratorCreateAudioResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.AudioProjectsClient.AudioProjectsDelete.g.cs b/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AudioProjectsDelete.g.cs index ce18e71..1704f15 100644 --- a/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AudioProjectsDelete.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AudioProjectsDelete.g.cs @@ -360,18 +360,17 @@ await AudioProjectsDeleteAsResponseAsync( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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 @@ await AudioProjectsDeleteAsResponseAsync( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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 @@ await AudioProjectsDeleteAsResponseAsync( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -474,18 +471,17 @@ await AudioProjectsDeleteAsResponseAsync( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -512,17 +508,15 @@ await AudioProjectsDeleteAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -550,17 +544,15 @@ await AudioProjectsDeleteAsResponseAsync( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.AudioProjectsClient.AudioProjectsGetDetails.g.cs b/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AudioProjectsGetDetails.g.cs index c79bec3..4b5081a 100644 --- a/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AudioProjectsGetDetails.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.AudioProjectsClient.AudioProjectsGetDetails.g.cs @@ -383,18 +383,17 @@ partial void ProcessAudioProjectsGetDetailsResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -421,18 +420,17 @@ partial void ProcessAudioProjectsGetDetailsResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -459,18 +457,17 @@ partial void ProcessAudioProjectsGetDetailsResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -497,18 +494,17 @@ partial void ProcessAudioProjectsGetDetailsResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -542,17 +538,15 @@ partial void ProcessAudioProjectsGetDetailsResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -589,17 +583,15 @@ partial void ProcessAudioProjectsGetDetailsResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.Exceptions.g.cs b/src/libs/MagicHour/Generated/MagicHour.Exceptions.g.cs index 0611e91..b591111 100644 --- a/src/libs/MagicHour/Generated/MagicHour.Exceptions.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.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::MagicHour.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::MagicHour.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::MagicHour.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::MagicHour.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::MagicHour.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::MagicHour.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::MagicHour.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::MagicHour.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/MagicHour/Generated/MagicHour.FilesClient.FaceDetectionDetectFaces.g.cs b/src/libs/MagicHour/Generated/MagicHour.FilesClient.FaceDetectionDetectFaces.g.cs index 889ea55..a1f0082 100644 --- a/src/libs/MagicHour/Generated/MagicHour.FilesClient.FaceDetectionDetectFaces.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.FilesClient.FaceDetectionDetectFaces.g.cs @@ -398,18 +398,17 @@ partial void ProcessFaceDetectionDetectFacesResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -436,18 +435,17 @@ partial void ProcessFaceDetectionDetectFacesResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -474,18 +472,17 @@ partial void ProcessFaceDetectionDetectFacesResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +509,17 @@ partial void ProcessFaceDetectionDetectFacesResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -550,18 +546,17 @@ partial void ProcessFaceDetectionDetectFacesResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -595,17 +590,15 @@ partial void ProcessFaceDetectionDetectFacesResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -642,17 +635,15 @@ partial void ProcessFaceDetectionDetectFacesResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.FilesClient.FaceDetectionGetDetails.g.cs b/src/libs/MagicHour/Generated/MagicHour.FilesClient.FaceDetectionGetDetails.g.cs index f8ef57d..0ade55e 100644 --- a/src/libs/MagicHour/Generated/MagicHour.FilesClient.FaceDetectionGetDetails.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.FilesClient.FaceDetectionGetDetails.g.cs @@ -369,18 +369,17 @@ partial void ProcessFaceDetectionGetDetailsResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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 ProcessFaceDetectionGetDetailsResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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 ProcessFaceDetectionGetDetailsResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -483,18 +480,17 @@ partial void ProcessFaceDetectionGetDetailsResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -521,18 +517,17 @@ partial void ProcessFaceDetectionGetDetailsResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -566,17 +561,15 @@ partial void ProcessFaceDetectionGetDetailsResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -613,17 +606,15 @@ partial void ProcessFaceDetectionGetDetailsResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.FilesClient.VideoAssetsGeneratePresignedUrl.g.cs b/src/libs/MagicHour/Generated/MagicHour.FilesClient.VideoAssetsGeneratePresignedUrl.g.cs index 7df51af..51596ae 100644 --- a/src/libs/MagicHour/Generated/MagicHour.FilesClient.VideoAssetsGeneratePresignedUrl.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.FilesClient.VideoAssetsGeneratePresignedUrl.g.cs @@ -430,18 +430,17 @@ partial void ProcessVideoAssetsGeneratePresignedUrlResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -468,18 +467,17 @@ partial void ProcessVideoAssetsGeneratePresignedUrlResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -506,18 +504,17 @@ partial void ProcessVideoAssetsGeneratePresignedUrlResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -544,18 +541,17 @@ partial void ProcessVideoAssetsGeneratePresignedUrlResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -582,18 +578,17 @@ partial void ProcessVideoAssetsGeneratePresignedUrlResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -627,17 +622,15 @@ partial void ProcessVideoAssetsGeneratePresignedUrlResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -674,17 +667,15 @@ partial void ProcessVideoAssetsGeneratePresignedUrlResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.AiClothesChangerCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiClothesChangerCreateImage.g.cs index 86c9264..4d7ee54 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiClothesChangerCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiClothesChangerCreateImage.g.cs @@ -396,18 +396,17 @@ partial void ProcessAiClothesChangerCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -434,18 +433,17 @@ partial void ProcessAiClothesChangerCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -472,18 +470,17 @@ partial void ProcessAiClothesChangerCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -510,18 +507,17 @@ partial void ProcessAiClothesChangerCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -548,18 +544,17 @@ partial void ProcessAiClothesChangerCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -593,17 +588,15 @@ partial void ProcessAiClothesChangerCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -640,17 +633,15 @@ partial void ProcessAiClothesChangerCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.AiFaceEditorEditImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiFaceEditorEditImage.g.cs index 3e247b0..ee9ceba 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiFaceEditorEditImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiFaceEditorEditImage.g.cs @@ -426,18 +426,17 @@ partial void ProcessAiFaceEditorEditImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -464,18 +463,17 @@ partial void ProcessAiFaceEditorEditImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -502,18 +500,17 @@ partial void ProcessAiFaceEditorEditImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -540,18 +537,17 @@ partial void ProcessAiFaceEditorEditImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -578,18 +574,17 @@ partial void ProcessAiFaceEditorEditImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -623,17 +618,15 @@ partial void ProcessAiFaceEditorEditImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -670,17 +663,15 @@ partial void ProcessAiFaceEditorEditImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.AiGifGeneratorCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiGifGeneratorCreateImage.g.cs index 8169c97..7aec118 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiGifGeneratorCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiGifGeneratorCreateImage.g.cs @@ -394,18 +394,17 @@ partial void ProcessAiGifGeneratorCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -432,18 +431,17 @@ partial void ProcessAiGifGeneratorCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -470,18 +468,17 @@ partial void ProcessAiGifGeneratorCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -508,18 +505,17 @@ partial void ProcessAiGifGeneratorCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -546,18 +542,17 @@ partial void ProcessAiGifGeneratorCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -591,17 +586,15 @@ partial void ProcessAiGifGeneratorCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -638,17 +631,15 @@ partial void ProcessAiGifGeneratorCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.AiHeadshotGeneratorCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiHeadshotGeneratorCreateImage.g.cs index aa93988..7ce65f6 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiHeadshotGeneratorCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiHeadshotGeneratorCreateImage.g.cs @@ -398,18 +398,17 @@ partial void ProcessAiHeadshotGeneratorCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -436,18 +435,17 @@ partial void ProcessAiHeadshotGeneratorCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -474,18 +472,17 @@ partial void ProcessAiHeadshotGeneratorCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -512,18 +509,17 @@ partial void ProcessAiHeadshotGeneratorCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -550,18 +546,17 @@ partial void ProcessAiHeadshotGeneratorCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -595,17 +590,15 @@ partial void ProcessAiHeadshotGeneratorCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -642,17 +635,15 @@ partial void ProcessAiHeadshotGeneratorCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageEditorCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageEditorCreateImage.g.cs index 57fabb5..c381ad2 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageEditorCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageEditorCreateImage.g.cs @@ -412,18 +412,17 @@ partial void ProcessAiImageEditorCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -450,18 +449,17 @@ partial void ProcessAiImageEditorCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -488,18 +486,17 @@ partial void ProcessAiImageEditorCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -526,18 +523,17 @@ partial void ProcessAiImageEditorCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -564,18 +560,17 @@ partial void ProcessAiImageEditorCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -609,17 +604,15 @@ partial void ProcessAiImageEditorCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -656,17 +649,15 @@ partial void ProcessAiImageEditorCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageGeneratorCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageGeneratorCreateImage.g.cs index 77862ad..2cfa878 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageGeneratorCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageGeneratorCreateImage.g.cs @@ -402,18 +402,17 @@ partial void ProcessAiImageGeneratorCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -440,18 +439,17 @@ partial void ProcessAiImageGeneratorCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -478,18 +476,17 @@ partial void ProcessAiImageGeneratorCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -516,18 +513,17 @@ partial void ProcessAiImageGeneratorCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -554,18 +550,17 @@ partial void ProcessAiImageGeneratorCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -599,17 +594,15 @@ partial void ProcessAiImageGeneratorCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -646,17 +639,15 @@ partial void ProcessAiImageGeneratorCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageUpscalerCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageUpscalerCreateImage.g.cs index 752b033..f459d21 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageUpscalerCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiImageUpscalerCreateImage.g.cs @@ -402,18 +402,17 @@ partial void ProcessAiImageUpscalerCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -440,18 +439,17 @@ partial void ProcessAiImageUpscalerCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -478,18 +476,17 @@ partial void ProcessAiImageUpscalerCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -516,18 +513,17 @@ partial void ProcessAiImageUpscalerCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -554,18 +550,17 @@ partial void ProcessAiImageUpscalerCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -599,17 +594,15 @@ partial void ProcessAiImageUpscalerCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -646,17 +639,15 @@ partial void ProcessAiImageUpscalerCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.AiMemeGeneratorCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiMemeGeneratorCreateImage.g.cs index e7be406..48a881e 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiMemeGeneratorCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiMemeGeneratorCreateImage.g.cs @@ -396,18 +396,17 @@ partial void ProcessAiMemeGeneratorCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -434,18 +433,17 @@ partial void ProcessAiMemeGeneratorCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -472,18 +470,17 @@ partial void ProcessAiMemeGeneratorCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -510,18 +507,17 @@ partial void ProcessAiMemeGeneratorCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -548,18 +544,17 @@ partial void ProcessAiMemeGeneratorCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -593,17 +588,15 @@ partial void ProcessAiMemeGeneratorCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -640,17 +633,15 @@ partial void ProcessAiMemeGeneratorCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.AiQrCodeGeneratorCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiQrCodeGeneratorCreateImage.g.cs index 3049ca4..b8377ea 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiQrCodeGeneratorCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.AiQrCodeGeneratorCreateImage.g.cs @@ -394,18 +394,17 @@ partial void ProcessAiQrCodeGeneratorCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -432,18 +431,17 @@ partial void ProcessAiQrCodeGeneratorCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -470,18 +468,17 @@ partial void ProcessAiQrCodeGeneratorCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -508,18 +505,17 @@ partial void ProcessAiQrCodeGeneratorCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -546,18 +542,17 @@ partial void ProcessAiQrCodeGeneratorCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -591,17 +586,15 @@ partial void ProcessAiQrCodeGeneratorCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -638,17 +631,15 @@ partial void ProcessAiQrCodeGeneratorCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.BodySwapCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.BodySwapCreateImage.g.cs index 68d3c78..ecfd881 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.BodySwapCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.BodySwapCreateImage.g.cs @@ -396,18 +396,17 @@ partial void ProcessBodySwapCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -434,18 +433,17 @@ partial void ProcessBodySwapCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -472,18 +470,17 @@ partial void ProcessBodySwapCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -510,18 +507,17 @@ partial void ProcessBodySwapCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -548,18 +544,17 @@ partial void ProcessBodySwapCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -593,17 +588,15 @@ partial void ProcessBodySwapCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -640,17 +633,15 @@ partial void ProcessBodySwapCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.FaceSwapPhotoCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.FaceSwapPhotoCreateImage.g.cs index cd5c28d..4a40e07 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.FaceSwapPhotoCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.FaceSwapPhotoCreateImage.g.cs @@ -408,18 +408,17 @@ partial void ProcessFaceSwapPhotoCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -446,18 +445,17 @@ partial void ProcessFaceSwapPhotoCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -484,18 +482,17 @@ partial void ProcessFaceSwapPhotoCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -522,18 +519,17 @@ partial void ProcessFaceSwapPhotoCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -560,18 +556,17 @@ partial void ProcessFaceSwapPhotoCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -605,17 +600,15 @@ partial void ProcessFaceSwapPhotoCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -652,17 +645,15 @@ partial void ProcessFaceSwapPhotoCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.HeadSwapCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.HeadSwapCreateImage.g.cs index 612f73a..740f7d4 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.HeadSwapCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.HeadSwapCreateImage.g.cs @@ -396,18 +396,17 @@ partial void ProcessHeadSwapCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Unauthorized if ((int)__response.StatusCode == 401) @@ -434,18 +433,17 @@ partial void ProcessHeadSwapCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -472,18 +470,17 @@ partial void ProcessHeadSwapCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -510,18 +507,17 @@ partial void ProcessHeadSwapCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -548,18 +544,17 @@ partial void ProcessHeadSwapCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -593,17 +588,15 @@ partial void ProcessHeadSwapCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -640,17 +633,15 @@ partial void ProcessHeadSwapCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageBackgroundRemoverCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageBackgroundRemoverCreateImage.g.cs index 135d536..70c5424 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageBackgroundRemoverCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageBackgroundRemoverCreateImage.g.cs @@ -394,18 +394,17 @@ partial void ProcessImageBackgroundRemoverCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -432,18 +431,17 @@ partial void ProcessImageBackgroundRemoverCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -470,18 +468,17 @@ partial void ProcessImageBackgroundRemoverCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -508,18 +505,17 @@ partial void ProcessImageBackgroundRemoverCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -546,18 +542,17 @@ partial void ProcessImageBackgroundRemoverCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -591,17 +586,15 @@ partial void ProcessImageBackgroundRemoverCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -638,17 +631,15 @@ partial void ProcessImageBackgroundRemoverCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageProjectsDelete.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageProjectsDelete.g.cs index e4c8d7e..5e7a658 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageProjectsDelete.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageProjectsDelete.g.cs @@ -360,18 +360,17 @@ await ImageProjectsDeleteAsResponseAsync( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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 @@ await ImageProjectsDeleteAsResponseAsync( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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 @@ await ImageProjectsDeleteAsResponseAsync( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -474,18 +471,17 @@ await ImageProjectsDeleteAsResponseAsync( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -512,17 +508,15 @@ await ImageProjectsDeleteAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -550,17 +544,15 @@ await ImageProjectsDeleteAsResponseAsync( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageProjectsGetDetails.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageProjectsGetDetails.g.cs index d93866f..17b469d 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageProjectsGetDetails.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.ImageProjectsGetDetails.g.cs @@ -383,18 +383,17 @@ partial void ProcessImageProjectsGetDetailsResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -421,18 +420,17 @@ partial void ProcessImageProjectsGetDetailsResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -459,18 +457,17 @@ partial void ProcessImageProjectsGetDetailsResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -497,18 +494,17 @@ partial void ProcessImageProjectsGetDetailsResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -542,17 +538,15 @@ partial void ProcessImageProjectsGetDetailsResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -589,17 +583,15 @@ partial void ProcessImageProjectsGetDetailsResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.ImageProjectsClient.PhotoColorizerCreateImage.g.cs b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.PhotoColorizerCreateImage.g.cs index 9bd5a9f..3e7bb9c 100644 --- a/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.PhotoColorizerCreateImage.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.ImageProjectsClient.PhotoColorizerCreateImage.g.cs @@ -392,18 +392,17 @@ partial void ProcessPhotoColorizerCreateImageResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -430,18 +429,17 @@ partial void ProcessPhotoColorizerCreateImageResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -468,18 +466,17 @@ partial void ProcessPhotoColorizerCreateImageResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -506,18 +503,17 @@ partial void ProcessPhotoColorizerCreateImageResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -544,18 +540,17 @@ partial void ProcessPhotoColorizerCreateImageResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -589,17 +584,15 @@ partial void ProcessPhotoColorizerCreateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -636,17 +629,15 @@ partial void ProcessPhotoColorizerCreateImageResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.VideoProjectsClient.AiTalkingPhotoCreateTalkingPhoto.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.AiTalkingPhotoCreateTalkingPhoto.g.cs index 1126e4a..621d1f4 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.AiTalkingPhotoCreateTalkingPhoto.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.AiTalkingPhotoCreateTalkingPhoto.g.cs @@ -408,18 +408,17 @@ partial void ProcessAiTalkingPhotoCreateTalkingPhotoResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -446,18 +445,17 @@ partial void ProcessAiTalkingPhotoCreateTalkingPhotoResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -484,18 +482,17 @@ partial void ProcessAiTalkingPhotoCreateTalkingPhotoResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -522,18 +519,17 @@ partial void ProcessAiTalkingPhotoCreateTalkingPhotoResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -560,18 +556,17 @@ partial void ProcessAiTalkingPhotoCreateTalkingPhotoResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -605,17 +600,15 @@ partial void ProcessAiTalkingPhotoCreateTalkingPhotoResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -652,17 +645,15 @@ partial void ProcessAiTalkingPhotoCreateTalkingPhotoResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.VideoProjectsClient.AnimationCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.AnimationCreateVideo.g.cs index 7630e79..dfc2e31 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.AnimationCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.AnimationCreateVideo.g.cs @@ -422,18 +422,17 @@ partial void ProcessAnimationCreateVideoResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -460,18 +459,17 @@ partial void ProcessAnimationCreateVideoResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -498,18 +496,17 @@ partial void ProcessAnimationCreateVideoResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -536,18 +533,17 @@ partial void ProcessAnimationCreateVideoResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -574,18 +570,17 @@ partial void ProcessAnimationCreateVideoResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -619,17 +614,15 @@ partial void ProcessAnimationCreateVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -666,17 +659,15 @@ partial void ProcessAnimationCreateVideoResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.VideoProjectsClient.AutoSubtitleGeneratorCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.AutoSubtitleGeneratorCreateVideo.g.cs index ddc55a0..3dd28ae 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.AutoSubtitleGeneratorCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.AutoSubtitleGeneratorCreateVideo.g.cs @@ -424,18 +424,17 @@ partial void ProcessAutoSubtitleGeneratorCreateVideoResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -462,18 +461,17 @@ partial void ProcessAutoSubtitleGeneratorCreateVideoResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -500,18 +498,17 @@ partial void ProcessAutoSubtitleGeneratorCreateVideoResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -538,18 +535,17 @@ partial void ProcessAutoSubtitleGeneratorCreateVideoResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -576,18 +572,17 @@ partial void ProcessAutoSubtitleGeneratorCreateVideoResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -621,17 +616,15 @@ partial void ProcessAutoSubtitleGeneratorCreateVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -668,17 +661,15 @@ partial void ProcessAutoSubtitleGeneratorCreateVideoResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.VideoProjectsClient.FaceSwapCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.FaceSwapCreateVideo.g.cs index 892f56a..022fe08 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.FaceSwapCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.FaceSwapCreateVideo.g.cs @@ -454,18 +454,17 @@ partial void ProcessFaceSwapCreateVideoResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -492,18 +491,17 @@ partial void ProcessFaceSwapCreateVideoResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -530,18 +528,17 @@ partial void ProcessFaceSwapCreateVideoResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -568,18 +565,17 @@ partial void ProcessFaceSwapCreateVideoResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -606,18 +602,17 @@ partial void ProcessFaceSwapCreateVideoResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -651,17 +646,15 @@ partial void ProcessFaceSwapCreateVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -698,17 +691,15 @@ partial void ProcessFaceSwapCreateVideoResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.VideoProjectsClient.ImageToVideoCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.ImageToVideoCreateVideo.g.cs index ae4fe21..0e331f9 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.ImageToVideoCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.ImageToVideoCreateVideo.g.cs @@ -440,18 +440,17 @@ partial void ProcessImageToVideoCreateVideoResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -478,18 +477,17 @@ partial void ProcessImageToVideoCreateVideoResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -516,18 +514,17 @@ partial void ProcessImageToVideoCreateVideoResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -554,18 +551,17 @@ partial void ProcessImageToVideoCreateVideoResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -592,18 +588,17 @@ partial void ProcessImageToVideoCreateVideoResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -637,17 +632,15 @@ partial void ProcessImageToVideoCreateVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -684,17 +677,15 @@ partial void ProcessImageToVideoCreateVideoResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.VideoProjectsClient.LipSyncCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.LipSyncCreateVideo.g.cs index 72c2e4e..2d096e0 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.LipSyncCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.LipSyncCreateVideo.g.cs @@ -442,18 +442,17 @@ partial void ProcessLipSyncCreateVideoResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -480,18 +479,17 @@ partial void ProcessLipSyncCreateVideoResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -518,18 +516,17 @@ partial void ProcessLipSyncCreateVideoResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -556,18 +553,17 @@ partial void ProcessLipSyncCreateVideoResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -594,18 +590,17 @@ partial void ProcessLipSyncCreateVideoResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -639,17 +634,15 @@ partial void ProcessLipSyncCreateVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -686,17 +679,15 @@ partial void ProcessLipSyncCreateVideoResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.VideoProjectsClient.TextToVideoCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.TextToVideoCreateVideo.g.cs index dc3796d..655dfc5 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.TextToVideoCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.TextToVideoCreateVideo.g.cs @@ -434,18 +434,17 @@ partial void ProcessTextToVideoCreateVideoResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -472,18 +471,17 @@ partial void ProcessTextToVideoCreateVideoResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -510,18 +508,17 @@ partial void ProcessTextToVideoCreateVideoResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -548,18 +545,17 @@ partial void ProcessTextToVideoCreateVideoResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -586,18 +582,17 @@ partial void ProcessTextToVideoCreateVideoResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -631,17 +626,15 @@ partial void ProcessTextToVideoCreateVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -678,17 +671,15 @@ partial void ProcessTextToVideoCreateVideoResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoProjectsDelete.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoProjectsDelete.g.cs index d5b7787..d1ce288 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoProjectsDelete.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoProjectsDelete.g.cs @@ -360,18 +360,17 @@ await VideoProjectsDeleteAsResponseAsync( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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 @@ await VideoProjectsDeleteAsResponseAsync( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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 @@ await VideoProjectsDeleteAsResponseAsync( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -474,18 +471,17 @@ await VideoProjectsDeleteAsResponseAsync( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -512,18 +508,17 @@ await VideoProjectsDeleteAsResponseAsync( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -550,17 +545,15 @@ await VideoProjectsDeleteAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -588,17 +581,15 @@ await VideoProjectsDeleteAsResponseAsync( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoProjectsGetDetails.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoProjectsGetDetails.g.cs index 3448c39..b15bd61 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoProjectsGetDetails.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoProjectsGetDetails.g.cs @@ -383,18 +383,17 @@ partial void ProcessVideoProjectsGetDetailsResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -421,18 +420,17 @@ partial void ProcessVideoProjectsGetDetailsResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -459,18 +457,17 @@ partial void ProcessVideoProjectsGetDetailsResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -497,18 +494,17 @@ partial void ProcessVideoProjectsGetDetailsResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -542,17 +538,15 @@ partial void ProcessVideoProjectsGetDetailsResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -589,17 +583,15 @@ partial void ProcessVideoProjectsGetDetailsResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoToVideoCreateVideo.g.cs b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoToVideoCreateVideo.g.cs index 0eb0fa6..999ccc3 100644 --- a/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoToVideoCreateVideo.g.cs +++ b/src/libs/MagicHour/Generated/MagicHour.VideoProjectsClient.VideoToVideoCreateVideo.g.cs @@ -448,18 +448,17 @@ partial void ProcessVideoToVideoCreateVideoResponseContent( __exception_400 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -486,18 +485,17 @@ partial void ProcessVideoToVideoCreateVideoResponseContent( __exception_401 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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) @@ -524,18 +522,17 @@ partial void ProcessVideoToVideoCreateVideoResponseContent( __exception_402 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Not Found if ((int)__response.StatusCode == 404) @@ -562,18 +559,17 @@ partial void ProcessVideoToVideoCreateVideoResponseContent( __exception_404 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } // Unprocessable Entity if ((int)__response.StatusCode == 422) @@ -600,18 +596,17 @@ partial void ProcessVideoToVideoCreateVideoResponseContent( __exception_422 = __ex; } - throw new global::MagicHour.ApiException( + + throw global::MagicHour.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)); } if (__effectiveReadResponseAsString) @@ -645,17 +640,15 @@ partial void ProcessVideoToVideoCreateVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -692,17 +685,15 @@ partial void ProcessVideoToVideoCreateVideoResponseContent( { } - throw new global::MagicHour.ApiException( + throw global::MagicHour.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } }