From 3c7cd3b130c1cd5edfa73487939e13dedb95a5a3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 18 Jun 2025 00:53:15 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Recraft/Generated/Recraft.Exceptions.g.cs | 4 +-- .../Recraft.ImageClient.CreativeUpscale.g.cs | 32 +++++++++---------- .../Recraft.ImageClient.CrispUpscale.g.cs | 32 +++++++++---------- .../Recraft.ImageClient.EraseRegion.g.cs | 32 +++++++++---------- ...ecraft.ImageClient.GenerateBackground.g.cs | 32 +++++++++---------- .../Recraft.ImageClient.GenerateImage.g.cs | 32 +++++++++---------- .../Recraft.ImageClient.ImageToImage.g.cs | 32 +++++++++---------- .../Recraft.ImageClient.InpaintImage.g.cs | 32 +++++++++---------- .../Recraft.ImageClient.RemoveBackground.g.cs | 32 +++++++++---------- ...Recraft.ImageClient.ReplaceBackground.g.cs | 32 +++++++++---------- .../Recraft.ImageClient.VectorizeImage.g.cs | 32 +++++++++---------- .../Recraft.RecraftClient.GetPing.g.cs | 20 ++++++------ ...Recraft.RecraftClient.GetSystemStatus.g.cs | 32 +++++++++---------- .../Recraft.StyleClient.CreateStyle.g.cs | 32 +++++++++---------- .../Recraft.StyleClient.DeleteStyle.g.cs | 24 +++++++------- .../Recraft.StyleClient.GetStyle.g.cs | 32 +++++++++---------- .../Recraft.StyleClient.ListBasicStyles.g.cs | 32 +++++++++---------- .../Recraft.StyleClient.ListStyles.g.cs | 32 +++++++++---------- .../Recraft.UserClient.GetCurrentUser.g.cs | 32 +++++++++---------- 19 files changed, 280 insertions(+), 280 deletions(-) diff --git a/src/libs/Recraft/Generated/Recraft.Exceptions.g.cs b/src/libs/Recraft/Generated/Recraft.Exceptions.g.cs index b9ff8d3..10c2136 100644 --- a/src/libs/Recraft/Generated/Recraft.Exceptions.g.cs +++ b/src/libs/Recraft/Generated/Recraft.Exceptions.g.cs @@ -43,7 +43,7 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference if no inner exception is specified. /// The HTTP status code of the response. - public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException) + public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException) { StatusCode = statusCode; } @@ -83,7 +83,7 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference if no inner exception is specified. /// The HTTP status code of the response. - public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) + public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) { } } diff --git a/src/libs/Recraft/Generated/Recraft.ImageClient.CreativeUpscale.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.CreativeUpscale.g.cs index d55c6a4..333a9b5 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.CreativeUpscale.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.CreativeUpscale.g.cs @@ -131,8 +131,12 @@ partial void ProcessCreativeUpscaleResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +150,24 @@ partial void ProcessCreativeUpscaleResponseContent( h => h.Value), }; } - - return - global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +180,6 @@ partial void ProcessCreativeUpscaleResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs index 22e4b60..6c4144b 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs @@ -131,8 +131,12 @@ partial void ProcessCrispUpscaleResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +150,24 @@ partial void ProcessCrispUpscaleResponseContent( h => h.Value), }; } - - return - global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +180,6 @@ partial void ProcessCrispUpscaleResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.ImageClient.EraseRegion.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.EraseRegion.g.cs index 7f8198e..61974b7 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.EraseRegion.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.EraseRegion.g.cs @@ -135,8 +135,12 @@ partial void ProcessEraseRegionResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -150,18 +154,24 @@ partial void ProcessEraseRegionResponseContent( h => h.Value), }; } - - return - global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -174,16 +184,6 @@ partial void ProcessEraseRegionResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateBackground.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateBackground.g.cs index e2e6554..2aba9b6 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateBackground.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateBackground.g.cs @@ -107,8 +107,12 @@ partial void ProcessGenerateBackgroundResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -122,18 +126,24 @@ partial void ProcessGenerateBackgroundResponseContent( h => h.Value), }; } - - return - global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -146,16 +156,6 @@ partial void ProcessGenerateBackgroundResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImage.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImage.g.cs index e6a7181..03503ff 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImage.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImage.g.cs @@ -113,8 +113,12 @@ partial void ProcessGenerateImageResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -128,18 +132,24 @@ partial void ProcessGenerateImageResponseContent( h => h.Value), }; } - - return - global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -152,16 +162,6 @@ partial void ProcessGenerateImageResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.ImageClient.ImageToImage.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.ImageToImage.g.cs index 9923d2a..46b63cd 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.ImageToImage.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.ImageToImage.g.cs @@ -203,8 +203,12 @@ partial void ProcessImageToImageResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -218,18 +222,24 @@ partial void ProcessImageToImageResponseContent( h => h.Value), }; } - - return - global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -242,16 +252,6 @@ partial void ProcessImageToImageResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.ImageClient.InpaintImage.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.InpaintImage.g.cs index 24ba61b..b971039 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.InpaintImage.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.InpaintImage.g.cs @@ -107,8 +107,12 @@ partial void ProcessInpaintImageResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -122,18 +126,24 @@ partial void ProcessInpaintImageResponseContent( h => h.Value), }; } - - return - global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -146,16 +156,6 @@ partial void ProcessInpaintImageResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.ImageClient.RemoveBackground.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.RemoveBackground.g.cs index df477c9..95fe390 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.RemoveBackground.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.RemoveBackground.g.cs @@ -131,8 +131,12 @@ partial void ProcessRemoveBackgroundResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +150,24 @@ partial void ProcessRemoveBackgroundResponseContent( h => h.Value), }; } - - return - global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +180,6 @@ partial void ProcessRemoveBackgroundResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.ImageClient.ReplaceBackground.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.ReplaceBackground.g.cs index d12bc58..943bdcd 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.ReplaceBackground.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.ReplaceBackground.g.cs @@ -194,8 +194,12 @@ partial void ProcessReplaceBackgroundResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -209,18 +213,24 @@ partial void ProcessReplaceBackgroundResponseContent( h => h.Value), }; } - - return - global::Recraft.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -233,16 +243,6 @@ partial void ProcessReplaceBackgroundResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.GenerateImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.ImageClient.VectorizeImage.g.cs b/src/libs/Recraft/Generated/Recraft.ImageClient.VectorizeImage.g.cs index bcce235..d28dd06 100644 --- a/src/libs/Recraft/Generated/Recraft.ImageClient.VectorizeImage.g.cs +++ b/src/libs/Recraft/Generated/Recraft.ImageClient.VectorizeImage.g.cs @@ -131,8 +131,12 @@ partial void ProcessVectorizeImageResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -146,18 +150,24 @@ partial void ProcessVectorizeImageResponseContent( h => h.Value), }; } - - return - global::Recraft.ProcessImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -170,16 +180,6 @@ partial void ProcessVectorizeImageResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.ProcessImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.RecraftClient.GetPing.g.cs b/src/libs/Recraft/Generated/Recraft.RecraftClient.GetPing.g.cs index 3d2c83a..e238754 100644 --- a/src/libs/Recraft/Generated/Recraft.RecraftClient.GetPing.g.cs +++ b/src/libs/Recraft/Generated/Recraft.RecraftClient.GetPing.g.cs @@ -90,8 +90,9 @@ partial void ProcessGetPingResponse( try { __response.EnsureSuccessStatusCode(); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -105,15 +106,21 @@ partial void ProcessGetPingResponse( h => h.Value), }; } - } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -126,13 +133,6 @@ partial void ProcessGetPingResponse( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } } } diff --git a/src/libs/Recraft/Generated/Recraft.RecraftClient.GetSystemStatus.g.cs b/src/libs/Recraft/Generated/Recraft.RecraftClient.GetSystemStatus.g.cs index 341b770..2b16cbf 100644 --- a/src/libs/Recraft/Generated/Recraft.RecraftClient.GetSystemStatus.g.cs +++ b/src/libs/Recraft/Generated/Recraft.RecraftClient.GetSystemStatus.g.cs @@ -99,8 +99,12 @@ partial void ProcessGetSystemStatusResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.SystemStatus.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -114,18 +118,24 @@ partial void ProcessGetSystemStatusResponseContent( h => h.Value), }; } - - return - global::Recraft.SystemStatus.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.SystemStatus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -138,16 +148,6 @@ partial void ProcessGetSystemStatusResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.SystemStatus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Recraft/Generated/Recraft.StyleClient.CreateStyle.g.cs b/src/libs/Recraft/Generated/Recraft.StyleClient.CreateStyle.g.cs index 54a2773..7283160 100644 --- a/src/libs/Recraft/Generated/Recraft.StyleClient.CreateStyle.g.cs +++ b/src/libs/Recraft/Generated/Recraft.StyleClient.CreateStyle.g.cs @@ -121,8 +121,12 @@ partial void ProcessCreateStyleResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.CreateStyleResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -136,18 +140,24 @@ partial void ProcessCreateStyleResponseContent( h => h.Value), }; } - - return - global::Recraft.CreateStyleResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.CreateStyleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -160,16 +170,6 @@ partial void ProcessCreateStyleResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.CreateStyleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Recraft/Generated/Recraft.StyleClient.DeleteStyle.g.cs b/src/libs/Recraft/Generated/Recraft.StyleClient.DeleteStyle.g.cs index 9ae171b..fd66864 100644 --- a/src/libs/Recraft/Generated/Recraft.StyleClient.DeleteStyle.g.cs +++ b/src/libs/Recraft/Generated/Recraft.StyleClient.DeleteStyle.g.cs @@ -105,8 +105,10 @@ partial void ProcessDeleteStyleResponseContent( try { __response.EnsureSuccessStatusCode(); + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -120,16 +122,22 @@ partial void ProcessDeleteStyleResponseContent( h => h.Value), }; } - - return __content; } else { try { __response.EnsureSuccessStatusCode(); + + var __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -142,14 +150,6 @@ partial void ProcessDeleteStyleResponseContent( h => h.Value), }; } - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; } } } diff --git a/src/libs/Recraft/Generated/Recraft.StyleClient.GetStyle.g.cs b/src/libs/Recraft/Generated/Recraft.StyleClient.GetStyle.g.cs index 2445ecf..2897f55 100644 --- a/src/libs/Recraft/Generated/Recraft.StyleClient.GetStyle.g.cs +++ b/src/libs/Recraft/Generated/Recraft.StyleClient.GetStyle.g.cs @@ -105,8 +105,12 @@ partial void ProcessGetStyleResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.Style.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -120,18 +124,24 @@ partial void ProcessGetStyleResponseContent( h => h.Value), }; } - - return - global::Recraft.Style.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.Style.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -144,16 +154,6 @@ partial void ProcessGetStyleResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.Style.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Recraft/Generated/Recraft.StyleClient.ListBasicStyles.g.cs b/src/libs/Recraft/Generated/Recraft.StyleClient.ListBasicStyles.g.cs index ba3d287..dbebf3e 100644 --- a/src/libs/Recraft/Generated/Recraft.StyleClient.ListBasicStyles.g.cs +++ b/src/libs/Recraft/Generated/Recraft.StyleClient.ListBasicStyles.g.cs @@ -99,8 +99,12 @@ partial void ProcessListBasicStylesResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.ListBasicStylesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -114,18 +118,24 @@ partial void ProcessListBasicStylesResponseContent( h => h.Value), }; } - - return - global::Recraft.ListBasicStylesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.ListBasicStylesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -138,16 +148,6 @@ partial void ProcessListBasicStylesResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.ListBasicStylesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Recraft/Generated/Recraft.StyleClient.ListStyles.g.cs b/src/libs/Recraft/Generated/Recraft.StyleClient.ListStyles.g.cs index f7fe502..3cfd29d 100644 --- a/src/libs/Recraft/Generated/Recraft.StyleClient.ListStyles.g.cs +++ b/src/libs/Recraft/Generated/Recraft.StyleClient.ListStyles.g.cs @@ -99,8 +99,12 @@ partial void ProcessListStylesResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.ListStylesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -114,18 +118,24 @@ partial void ProcessListStylesResponseContent( h => h.Value), }; } - - return - global::Recraft.ListStylesResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.ListStylesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -138,16 +148,6 @@ partial void ProcessListStylesResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.ListStylesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } } diff --git a/src/libs/Recraft/Generated/Recraft.UserClient.GetCurrentUser.g.cs b/src/libs/Recraft/Generated/Recraft.UserClient.GetCurrentUser.g.cs index 0fc9e2f..b0924c4 100644 --- a/src/libs/Recraft/Generated/Recraft.UserClient.GetCurrentUser.g.cs +++ b/src/libs/Recraft/Generated/Recraft.UserClient.GetCurrentUser.g.cs @@ -99,8 +99,12 @@ partial void ProcessGetCurrentUserResponseContent( try { __response.EnsureSuccessStatusCode(); + + return + global::Recraft.User.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __content ?? __response.ReasonPhrase ?? string.Empty, @@ -114,18 +118,24 @@ partial void ProcessGetCurrentUserResponseContent( h => h.Value), }; } - - return - global::Recraft.User.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } else { try { __response.EnsureSuccessStatusCode(); + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Recraft.User.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); } - catch (global::System.Net.Http.HttpRequestException __ex) + catch (global::System.Exception __ex) { throw new global::Recraft.ApiException( message: __response.ReasonPhrase ?? string.Empty, @@ -138,16 +148,6 @@ partial void ProcessGetCurrentUserResponseContent( h => h.Value), }; } - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::Recraft.User.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); } } }