diff --git a/src/libs/PixVerse/Generated/PixVerse.Exceptions.g.cs b/src/libs/PixVerse/Generated/PixVerse.Exceptions.g.cs index f0dd7e9..c80069e 100644 --- a/src/libs/PixVerse/Generated/PixVerse.Exceptions.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.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::PixVerse.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::PixVerse.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::PixVerse.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::PixVerse.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::PixVerse.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::PixVerse.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::PixVerse.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::PixVerse.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/PixVerse/Generated/PixVerse.PixVerseClient.CreateFusionVideo.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateFusionVideo.g.cs index 5d52eb7..c231819 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateFusionVideo.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateFusionVideo.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateFusionVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateFusionVideoResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateImageTemplate.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateImageTemplate.g.cs index a4dd4b3..8108aa8 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateImageTemplate.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateImageTemplate.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateImageTemplateResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateImageTemplateResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateImageToVideo.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateImageToVideo.g.cs index 9e4858f..0d5900e 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateImageToVideo.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateImageToVideo.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateImageToVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateImageToVideoResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateLipSyncVideo.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateLipSyncVideo.g.cs index b1ddf34..f772122 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateLipSyncVideo.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateLipSyncVideo.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateLipSyncVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateLipSyncVideoResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateMimicVideo.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateMimicVideo.g.cs index 9321a18..9284afa 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateMimicVideo.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateMimicVideo.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateMimicVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateMimicVideoResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateModifiedVideo.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateModifiedVideo.g.cs index 4884075..27bb475 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateModifiedVideo.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateModifiedVideo.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateModifiedVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateModifiedVideoResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateMultiTransitionVideo.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateMultiTransitionVideo.g.cs index 572479c..d227393 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateMultiTransitionVideo.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateMultiTransitionVideo.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateMultiTransitionVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateMultiTransitionVideoResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateRestyleVideo.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateRestyleVideo.g.cs index 256bccf..90a5015 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateRestyleVideo.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateRestyleVideo.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateRestyleVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateRestyleVideoResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateSoundEffect.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateSoundEffect.g.cs index 72a7f88..68b839f 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateSoundEffect.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateSoundEffect.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateSoundEffectResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateSoundEffectResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateSwapVideo.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateSwapVideo.g.cs index afc25b3..78fb9ed 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateSwapVideo.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateSwapVideo.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateSwapVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateSwapVideoResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateTextToVideo.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateTextToVideo.g.cs index 0e9db1e..c228322 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateTextToVideo.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateTextToVideo.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateTextToVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateTextToVideoResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateTransitionVideo.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateTransitionVideo.g.cs index 4024c94..b977b7d 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateTransitionVideo.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateTransitionVideo.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateTransitionVideoResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateTransitionVideoResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateVideoExtension.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateVideoExtension.g.cs index f05983a..b24bf21 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateVideoExtension.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateVideoExtension.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateVideoExtensionResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateVideoExtensionResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.CreateVideoMaskSelection.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateVideoMaskSelection.g.cs index fa0d5be..79e73f9 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateVideoMaskSelection.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.CreateVideoMaskSelection.g.cs @@ -367,17 +367,15 @@ partial void ProcessCreateVideoMaskSelectionResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -414,17 +412,15 @@ partial void ProcessCreateVideoMaskSelectionResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.GetAccountBalance.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.GetAccountBalance.g.cs index 6c503fa..efb1034 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.GetAccountBalance.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.GetAccountBalance.g.cs @@ -347,17 +347,15 @@ partial void ProcessGetAccountBalanceResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -394,17 +392,15 @@ partial void ProcessGetAccountBalanceResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.GetImageResult.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.GetImageResult.g.cs index abf23da..99cb37a 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.GetImageResult.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.GetImageResult.g.cs @@ -356,17 +356,15 @@ partial void ProcessGetImageResultResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -403,17 +401,15 @@ partial void ProcessGetImageResultResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.GetVideoResult.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.GetVideoResult.g.cs index 1955208..a0a22b2 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.GetVideoResult.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.GetVideoResult.g.cs @@ -356,17 +356,15 @@ partial void ProcessGetVideoResultResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -403,17 +401,15 @@ partial void ProcessGetVideoResultResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.ListLipSyncTtsVoices.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.ListLipSyncTtsVoices.g.cs index e5a92b6..e7e694a 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.ListLipSyncTtsVoices.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.ListLipSyncTtsVoices.g.cs @@ -347,17 +347,15 @@ partial void ProcessListLipSyncTtsVoicesResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -394,17 +392,15 @@ partial void ProcessListLipSyncTtsVoicesResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.ListRestyleEffects.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.ListRestyleEffects.g.cs index d2dd7ee..7236007 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.ListRestyleEffects.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.ListRestyleEffects.g.cs @@ -347,17 +347,15 @@ partial void ProcessListRestyleEffectsResponseContent( } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -394,17 +392,15 @@ partial void ProcessListRestyleEffectsResponseContent( { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.UploadImage.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.UploadImage.g.cs index f5058e1..5a504b0 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.UploadImage.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.UploadImage.g.cs @@ -403,17 +403,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -450,17 +448,15 @@ request.Imagename is null { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -841,17 +837,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -884,17 +878,15 @@ request.Imagename is null { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1253,17 +1245,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1300,17 +1290,15 @@ request.Imagename is null { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/PixVerse/Generated/PixVerse.PixVerseClient.UploadMedia.g.cs b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.UploadMedia.g.cs index 6a50569..bfa88e0 100644 --- a/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.UploadMedia.g.cs +++ b/src/libs/PixVerse/Generated/PixVerse.PixVerseClient.UploadMedia.g.cs @@ -403,17 +403,15 @@ request.Medianame is null } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -450,17 +448,15 @@ request.Medianame is null { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -841,17 +837,15 @@ request.Medianame is null } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -884,17 +878,15 @@ request.Medianame is null { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1253,17 +1245,15 @@ request.Medianame is null } catch (global::System.Exception __ex) { - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1300,17 +1290,15 @@ request.Medianame is null { } - throw new global::PixVerse.ApiException( + throw global::PixVerse.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } }