diff --git a/src/libs/Recraft/Generated/Recraft.ColorsClient.OptimizeColors.g.cs b/src/libs/Recraft/Generated/Recraft.ColorsClient.OptimizeColors.g.cs index 5f9917e..32bb13a 100644 --- a/src/libs/Recraft/Generated/Recraft.ColorsClient.OptimizeColors.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ColorsClient.OptimizeColors.g.cs @@ -379,17 +379,15 @@ partial void ProcessOptimizeColorsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -426,17 +424,15 @@ partial void ProcessOptimizeColorsResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.Exceptions.g.cs b/src/libs/Recraft/Generated/Recraft.Exceptions.g.cs index e4172eb..2f27924 100644 --- a/src/libs/Recraft/Generated/Recraft.Exceptions.g.cs +++ b/src/libs/Recraft/Generated/Recraft.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::Recraft.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Recraft.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::Recraft.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::Recraft.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::Recraft.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Recraft.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::Recraft.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::Recraft.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/Recraft/Generated/Recraft.ImageClient.CreativeUpscale.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.CreativeUpscale.g.cs index e502059..65002b8 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.CreativeUpscale.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.CreativeUpscale.g.cs @@ -456,17 +456,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -503,17 +501,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -969,17 +965,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1012,17 +1006,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1441,17 +1433,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1488,17 +1478,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs index 60565af..e6c1e20 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs @@ -456,17 +456,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -503,17 +501,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -969,17 +965,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1012,17 +1006,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1441,17 +1433,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1488,17 +1478,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.EraseRegion.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.EraseRegion.g.cs index 1288899..f44e205 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.EraseRegion.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.EraseRegion.g.cs @@ -486,17 +486,15 @@ request.Maskname is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -533,17 +531,15 @@ request.Maskname is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1038,17 +1034,15 @@ request.Maskname is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1081,17 +1075,15 @@ request.Maskname is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1546,17 +1538,15 @@ request.Maskname is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1593,17 +1583,15 @@ request.Maskname is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.Explore.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.Explore.g.cs index 744ed72..e61ad19 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.Explore.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.Explore.g.cs @@ -379,17 +379,15 @@ partial void ProcessExploreResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -426,17 +424,15 @@ partial void ProcessExploreResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.ExploreSimilar.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.ExploreSimilar.g.cs index e04d53f..4e39afa 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.ExploreSimilar.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.ExploreSimilar.g.cs @@ -379,17 +379,15 @@ partial void ProcessExploreSimilarResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -426,17 +424,15 @@ partial void ProcessExploreSimilarResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.GenerateBackground.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateBackground.g.cs index f126d97..4fe544c 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateBackground.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateBackground.g.cs @@ -384,17 +384,15 @@ partial void ProcessGenerateBackgroundResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -431,17 +429,15 @@ partial void ProcessGenerateBackgroundResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.GenerateImage.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImage.g.cs index b45c3c2..068a710 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImage.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImage.g.cs @@ -379,17 +379,15 @@ partial void ProcessGenerateImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -426,17 +424,15 @@ partial void ProcessGenerateImageResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.GenerateImageRaster.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImageRaster.g.cs index 22f07d2..aed0c8c 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImageRaster.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImageRaster.g.cs @@ -379,17 +379,15 @@ partial void ProcessGenerateImageRasterResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -426,17 +424,15 @@ partial void ProcessGenerateImageRasterResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.GenerateImageVector.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImageVector.g.cs index 93b4d0a..cacb657 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImageVector.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImageVector.g.cs @@ -379,17 +379,15 @@ partial void ProcessGenerateImageVectorResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -426,17 +424,15 @@ partial void ProcessGenerateImageVectorResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.ImageToImage.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.ImageToImage.g.cs index 2fba7aa..8e6be73 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.ImageToImage.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.ImageToImage.g.cs @@ -384,17 +384,15 @@ partial void ProcessImageToImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -431,17 +429,15 @@ partial void ProcessImageToImageResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.InpaintImage.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.InpaintImage.g.cs index 226a41f..bfce50f 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.InpaintImage.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.InpaintImage.g.cs @@ -384,17 +384,15 @@ partial void ProcessInpaintImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -431,17 +429,15 @@ partial void ProcessInpaintImageResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.OutpaintImage.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.OutpaintImage.g.cs index ed12e99..03ff337 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.OutpaintImage.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.OutpaintImage.g.cs @@ -384,17 +384,15 @@ partial void ProcessOutpaintImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -431,17 +429,15 @@ partial void ProcessOutpaintImageResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.RemoveBackground.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.RemoveBackground.g.cs index 71bf509..60d63de 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.RemoveBackground.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.RemoveBackground.g.cs @@ -456,17 +456,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -503,17 +501,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -969,17 +965,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1012,17 +1006,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1441,17 +1433,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1488,17 +1478,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.ReplaceBackground.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.ReplaceBackground.g.cs index 2e1c116..73fa6e0 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.ReplaceBackground.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.ReplaceBackground.g.cs @@ -548,17 +548,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -595,17 +593,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1225,17 +1221,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1268,17 +1262,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1825,17 +1817,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1872,17 +1862,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.VariateImage.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.VariateImage.g.cs index e96d980..e7e4d1d 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.VariateImage.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.VariateImage.g.cs @@ -475,17 +475,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -522,17 +520,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1025,17 +1021,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1068,17 +1062,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1525,17 +1517,15 @@ request.Imagename is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1572,17 +1562,15 @@ request.Imagename is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.ImageClient.VectorizeImage.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.VectorizeImage.g.cs index 04780c5..2439d98 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.VectorizeImage.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.VectorizeImage.g.cs @@ -384,17 +384,15 @@ partial void ProcessVectorizeImageResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -431,17 +429,15 @@ partial void ProcessVectorizeImageResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.PromptClient.EnhancePrompt.g.cs b/src/libs/Recraft/Generated/Recraft.PromptClient.EnhancePrompt.g.cs index 97be1ea..f441560 100644 --- a/src/libs/Recraft/Generated/Recraft.PromptClient.EnhancePrompt.g.cs +++ b/src/libs/Recraft/Generated/Recraft.PromptClient.EnhancePrompt.g.cs @@ -379,17 +379,15 @@ partial void ProcessEnhancePromptResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -426,17 +424,15 @@ partial void ProcessEnhancePromptResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.RecraftClient.GetPing.g.cs b/src/libs/Recraft/Generated/Recraft.RecraftClient.GetPing.g.cs index 60a1763..f00052d 100644 --- a/src/libs/Recraft/Generated/Recraft.RecraftClient.GetPing.g.cs +++ b/src/libs/Recraft/Generated/Recraft.RecraftClient.GetPing.g.cs @@ -333,17 +333,15 @@ await GetPingAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -371,17 +369,15 @@ await GetPingAsResponseAsync( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.RecraftClient.GetSystemStatus.g.cs b/src/libs/Recraft/Generated/Recraft.RecraftClient.GetSystemStatus.g.cs index 99d5ce8..fd6c677 100644 --- a/src/libs/Recraft/Generated/Recraft.RecraftClient.GetSystemStatus.g.cs +++ b/src/libs/Recraft/Generated/Recraft.RecraftClient.GetSystemStatus.g.cs @@ -347,17 +347,15 @@ partial void ProcessGetSystemStatusResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 ProcessGetSystemStatusResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.StyleClient.CreateStyle.g.cs b/src/libs/Recraft/Generated/Recraft.StyleClient.CreateStyle.g.cs index e20105b..619fbf1 100644 --- a/src/libs/Recraft/Generated/Recraft.StyleClient.CreateStyle.g.cs +++ b/src/libs/Recraft/Generated/Recraft.StyleClient.CreateStyle.g.cs @@ -467,17 +467,15 @@ partial void ProcessCreateStyleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -514,17 +512,15 @@ partial void ProcessCreateStyleResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1051,17 +1047,15 @@ __fileNameImages is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1094,17 +1088,15 @@ __fileNameImages is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } @@ -1582,17 +1574,15 @@ __fileNameImages is null } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -1629,17 +1619,15 @@ __fileNameImages is null { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.StyleClient.DeleteStyle.g.cs b/src/libs/Recraft/Generated/Recraft.StyleClient.DeleteStyle.g.cs index 2ac93b8..f5bc156 100644 --- a/src/libs/Recraft/Generated/Recraft.StyleClient.DeleteStyle.g.cs +++ b/src/libs/Recraft/Generated/Recraft.StyleClient.DeleteStyle.g.cs @@ -354,17 +354,15 @@ partial void ProcessDeleteStyleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -399,17 +397,15 @@ partial void ProcessDeleteStyleResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.StyleClient.GetStyle.g.cs b/src/libs/Recraft/Generated/Recraft.StyleClient.GetStyle.g.cs index 1e9f022..3cbfd72 100644 --- a/src/libs/Recraft/Generated/Recraft.StyleClient.GetStyle.g.cs +++ b/src/libs/Recraft/Generated/Recraft.StyleClient.GetStyle.g.cs @@ -356,17 +356,15 @@ partial void ProcessGetStyleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 ProcessGetStyleResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.StyleClient.ListBasicStyles.g.cs b/src/libs/Recraft/Generated/Recraft.StyleClient.ListBasicStyles.g.cs index 61e772a..ea3903f 100644 --- a/src/libs/Recraft/Generated/Recraft.StyleClient.ListBasicStyles.g.cs +++ b/src/libs/Recraft/Generated/Recraft.StyleClient.ListBasicStyles.g.cs @@ -347,17 +347,15 @@ partial void ProcessListBasicStylesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 ProcessListBasicStylesResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.StyleClient.ListStyles.g.cs b/src/libs/Recraft/Generated/Recraft.StyleClient.ListStyles.g.cs index d3bb70e..9df62b0 100644 --- a/src/libs/Recraft/Generated/Recraft.StyleClient.ListStyles.g.cs +++ b/src/libs/Recraft/Generated/Recraft.StyleClient.ListStyles.g.cs @@ -347,17 +347,15 @@ partial void ProcessListStylesResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 ProcessListStylesResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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/Recraft/Generated/Recraft.UserClient.GetCurrentUser.g.cs b/src/libs/Recraft/Generated/Recraft.UserClient.GetCurrentUser.g.cs index baf7bf1..e3e7fe5 100644 --- a/src/libs/Recraft/Generated/Recraft.UserClient.GetCurrentUser.g.cs +++ b/src/libs/Recraft/Generated/Recraft.UserClient.GetCurrentUser.g.cs @@ -359,17 +359,15 @@ partial void ProcessGetCurrentUserResponseContent( } catch (global::System.Exception __ex) { - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = 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 @@ -406,17 +404,15 @@ partial void ProcessGetCurrentUserResponseContent( { } - throw new global::Recraft.ApiException( + throw global::Recraft.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } }