Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
}
}
}
126 changes: 121 additions & 5 deletions src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
}

/// <summary>
Expand Down
Loading