diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs index ea00a11..33c8df7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs @@ -79,23 +79,115 @@ partial void ProcessDeleteSingleApiKeyResponse( ProcessDeleteSingleApiKeyResponse( httpClient: HttpClient, httpResponseMessage: __response); - try + // + if ((int)__response.StatusCode == 400) { - __response.EnsureSuccessStatusCode(); + string? __content_400 = null; + if (ReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_400 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + + throw new global::Ideogram.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; } - catch (global::System.Net.Http.HttpRequestException __ex) + // + if ((int)__response.StatusCode == 401) { + string? __content_401 = null; + if (ReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_401 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + throw new global::Ideogram.ApiException( - message: __response.ReasonPhrase ?? string.Empty, - innerException: __ex, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, statusCode: __response.StatusCode) { + ResponseBody = __content_401, ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, h => h.Value), }; } + + if (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Ideogram.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + } } } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs index af5d644..d9bfb85 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs @@ -87,23 +87,139 @@ partial void ProcessPostApiTermsResponse( ProcessPostApiTermsResponse( httpClient: HttpClient, httpResponseMessage: __response); - try + // + if ((int)__response.StatusCode == 400) { - __response.EnsureSuccessStatusCode(); + string? __content_400 = null; + if (ReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_400 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + + throw new global::Ideogram.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; } - catch (global::System.Net.Http.HttpRequestException __ex) + // + if ((int)__response.StatusCode == 401) { + string? __content_401 = null; + if (ReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_401 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + throw new global::Ideogram.ApiException( - message: __response.ReasonPhrase ?? string.Empty, - innerException: __ex, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, statusCode: __response.StatusCode) { + ResponseBody = __content_401, ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, h => h.Value), }; } + // + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + if (ReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_403 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + + throw new global::Ideogram.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Ideogram.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + } } ///