diff --git a/src/libs/Ideogram/Generated/Ideogram.Exceptions.g.cs b/src/libs/Ideogram/Generated/Ideogram.Exceptions.g.cs new file mode 100644 index 0000000..c801e40 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Exceptions.g.cs @@ -0,0 +1,90 @@ +#nullable enable + +namespace Ideogram +{ + /// + /// Represents an exception thrown by the API. + /// + [global::System.Serializable] + public partial class ApiException : global::System.Exception + { + /// + /// The HTTP status code of the response. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// The response body. + /// + public string? ResponseBody { get; set; } + /// + /// The response headers. + /// + public global::System.Collections.Generic.Dictionary>? ResponseHeaders { get; set; } + /// + /// Initializes a new instance of the class. + /// + public ApiException() + { + } + + /// + /// Initializes a new instance of the class with a specified error message. + /// + /// The message that describes the error. + /// The HTTP status code of the response. + public ApiException(string message, global::System.Net.HttpStatusCode statusCode) : base(message) + { + StatusCode = statusCode; + } + + /// + /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. + /// + /// 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 = statusCode; + } + } + + /// + /// Represents an exception thrown by the API. + /// + /// + [global::System.Serializable] + public partial class ApiException : ApiException + { + /// + /// The response object. + /// + public T? ResponseObject { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() + { + } + + /// + /// Initializes a new instance of the class with a specified error message. + /// + /// The message that describes the error. + /// The HTTP status code of the response. + public ApiException(string message, global::System.Net.HttpStatusCode statusCode) : base(message, statusCode) + { + } + + /// + /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. + /// + /// 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) + { + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostEditImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostEditImage.g.cs index 0945fe3..a3753ac 100644 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostEditImage.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostEditImage.g.cs @@ -30,7 +30,7 @@ partial void ProcessPostEditImageResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task PostEditImageAsync( global::Ideogram.EditImageRequest request, global::System.Threading.CancellationToken cancellationToken = default) @@ -120,30 +120,171 @@ partial void ProcessPostEditImageResponseContent( ProcessPostEditImageResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + if ((int)__response.StatusCode == 400) + { + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + 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); + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostEditImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Prompt or Initial Image failed the safety checks. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::Ideogram.GenerateImageSafetyError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Ideogram.GenerateImageSafetyError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - try + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 429) { - __response.EnsureSuccessStatusCode(); + string? __content_429 = null; + if (ReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_429 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; } - catch (global::System.Net.Http.HttpRequestException __ex) + + if (ReadResponseAsString) { - throw new global::System.InvalidOperationException(__content, __ex); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPostEditImageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } + 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 __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - return - global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + var __responseValue = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImage.g.cs index 2593b26..5ad7518 100644 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImage.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImage.g.cs @@ -28,7 +28,7 @@ partial void ProcessPostGenerateImageResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task PostGenerateImageAsync( global::Ideogram.GenerateImageRequest request, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,30 +90,171 @@ partial void ProcessPostGenerateImageResponseContent( ProcessPostGenerateImageResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + if ((int)__response.StatusCode == 400) + { + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + 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); + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostGenerateImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Prompt failed the safety check. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::Ideogram.GenerateImageSafetyError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Ideogram.GenerateImageSafetyError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - try + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 429) { - __response.EnsureSuccessStatusCode(); + string? __content_429 = null; + if (ReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_429 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; } - catch (global::System.Net.Http.HttpRequestException __ex) + + if (ReadResponseAsString) { - throw new global::System.InvalidOperationException(__content, __ex); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPostGenerateImageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } + 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 __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - return - global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + var __responseValue = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImage.g.cs index f13484c..3fedbda 100644 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImage.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImage.g.cs @@ -30,7 +30,7 @@ partial void ProcessPostRemixImageResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task PostRemixImageAsync( global::Ideogram.RemixImageRequest request, global::System.Threading.CancellationToken cancellationToken = default) @@ -95,30 +95,171 @@ partial void ProcessPostRemixImageResponseContent( ProcessPostRemixImageResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + if ((int)__response.StatusCode == 400) + { + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + 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); + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostRemixImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Prompt or provided image failed safety check. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::Ideogram.GenerateImageSafetyError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Ideogram.GenerateImageSafetyError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - try + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 429) { - __response.EnsureSuccessStatusCode(); + string? __content_429 = null; + if (ReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_429 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; } - catch (global::System.Net.Http.HttpRequestException __ex) + + if (ReadResponseAsString) { - throw new global::System.InvalidOperationException(__content, __ex); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPostRemixImageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } + 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 __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - return - global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + var __responseValue = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostUpscaleImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostUpscaleImage.g.cs index 4ea6369..0f3ad97 100644 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostUpscaleImage.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostUpscaleImage.g.cs @@ -29,7 +29,7 @@ partial void ProcessPostUpscaleImageResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task PostUpscaleImageAsync( global::Ideogram.UpscaleImageRequest request, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,30 +94,171 @@ partial void ProcessPostUpscaleImageResponseContent( ProcessPostUpscaleImageResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + if ((int)__response.StatusCode == 400) + { + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + 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); + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostUpscaleImageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Prompt or provided image failed safety check. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::Ideogram.GenerateImageSafetyError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.GenerateImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Ideogram.GenerateImageSafetyError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - try + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 429) { - __response.EnsureSuccessStatusCode(); + string? __content_429 = null; + if (ReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_429 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; } - catch (global::System.Net.Http.HttpRequestException __ex) + + if (ReadResponseAsString) { - throw new global::System.InvalidOperationException(__content, __ex); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPostUpscaleImageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } + 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 __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - return - global::Ideogram.GenerateImageResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + var __responseValue = await global::Ideogram.GenerateImageResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.g.cs index 57cbe4b..b50e807 100644 --- a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.g.cs @@ -26,6 +26,11 @@ public sealed partial class GenerateClient : global::Ideogram.IGenerateClient, g /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostEditImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostEditImage.g.cs index 333ac77..db1f60e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostEditImage.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostEditImage.g.cs @@ -13,7 +13,7 @@ public partial interface IGenerateClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task PostEditImageAsync( global::Ideogram.EditImageRequest request, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImage.g.cs index b68533a..c3d4dd7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImage.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImage.g.cs @@ -11,7 +11,7 @@ public partial interface IGenerateClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task PostGenerateImageAsync( global::Ideogram.GenerateImageRequest request, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImage.g.cs index da7e8d2..8d361dd 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImage.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImage.g.cs @@ -13,7 +13,7 @@ public partial interface IGenerateClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task PostRemixImageAsync( global::Ideogram.RemixImageRequest request, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostUpscaleImage.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostUpscaleImage.g.cs index c56af88..fd8747e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostUpscaleImage.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostUpscaleImage.g.cs @@ -12,7 +12,7 @@ public partial interface IGenerateClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task PostUpscaleImageAsync( global::Ideogram.UpscaleImageRequest request, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.g.cs index 8637259..cfb13c0 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.g.cs @@ -25,6 +25,12 @@ public partial interface IGenerateClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/Ideogram/Generated/Ideogram.IIdeogramApi.g.cs b/src/libs/Ideogram/Generated/Ideogram.IIdeogramApi.g.cs index e616723..6c8c7b9 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IIdeogramApi.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IIdeogramApi.g.cs @@ -25,6 +25,12 @@ public partial interface IIdeogramApi : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.PostInternalTesting.g.cs b/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.PostInternalTesting.g.cs index a655911..94c3b70 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.PostInternalTesting.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.PostInternalTesting.g.cs @@ -10,7 +10,7 @@ public partial interface IInternalTestingClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task PostInternalTestingAsync( global::Ideogram.InternalTestingRequest request, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.g.cs index 91171ab..5f0d8dc 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IInternalTestingClient.g.cs @@ -25,6 +25,12 @@ public partial interface IInternalTestingClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKey.g.cs index e44923d..3a93d80 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKey.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IManageClient.CreateApiKey.g.cs @@ -8,7 +8,7 @@ public partial interface IManageClient /// Creates an API key. /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task CreateApiKeyAsync( global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.DeleteSingleApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.DeleteSingleApiKey.g.cs index 1f7ba9b..4a2a1e6 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.DeleteSingleApiKey.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IManageClient.DeleteSingleApiKey.g.cs @@ -9,7 +9,7 @@ public partial interface IManageClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task DeleteSingleApiKeyAsync( string apiKeyId, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeys.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeys.g.cs index 68abad4..2c784b3 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeys.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiKeys.g.cs @@ -8,7 +8,7 @@ public partial interface IManageClient /// Retrieve current API keys and their respective data. /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task GetApiKeysAsync( global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiStripeSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiStripeSubscription.g.cs index 86f0afb..5a5d9fe 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiStripeSubscription.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiStripeSubscription.g.cs @@ -9,7 +9,7 @@ public partial interface IManageClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task GetApiStripeSubscriptionAsync( bool? isBusiness = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiSubscription.g.cs index 9dcf7c5..f2b55fe 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiSubscription.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiSubscription.g.cs @@ -8,7 +8,7 @@ public partial interface IManageClient /// Retrieve data relevant to creating an API subscription. /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task GetApiSubscriptionAsync( global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiTerms.g.cs index 8c921e7..205e1fd 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiTerms.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IManageClient.GetApiTerms.g.cs @@ -8,7 +8,7 @@ public partial interface IManageClient /// Retrieve the latest terms of service for API usage. /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task GetApiTermsAsync( global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiSubscription.g.cs index cac5dcc..5902ab7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiSubscription.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiSubscription.g.cs @@ -9,7 +9,7 @@ public partial interface IManageClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task PostApiSubscriptionAsync( global::Ideogram.PostApiSubscriptionRequest request, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiTerms.g.cs index 9e813fa..089d326 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiTerms.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IManageClient.PostApiTerms.g.cs @@ -9,7 +9,7 @@ public partial interface IManageClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task PostApiTermsAsync( global::Ideogram.PostApiTermsRequest request, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.ReactivateSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.ReactivateSubscription.g.cs index 327a882..98278be 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.ReactivateSubscription.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IManageClient.ReactivateSubscription.g.cs @@ -8,7 +8,7 @@ public partial interface IManageClient /// Reactivates a subscription by attempting to re-enable Metronome billing. /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task ReactivateSubscriptionAsync( global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Ideogram/Generated/Ideogram.IManageClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IManageClient.g.cs index 6bc9866..cb09d5b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IManageClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IManageClient.g.cs @@ -25,6 +25,12 @@ public partial interface IManageClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribe.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribe.g.cs index e832030..7fca756 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribe.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IVisionClient.PostDescribe.g.cs @@ -11,7 +11,7 @@ public partial interface IVisionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task PostDescribeAsync( global::Ideogram.DescribeRequest request, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.IVisionClient.g.cs index 353bf0f..35a4bbd 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IVisionClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IVisionClient.g.cs @@ -25,6 +25,12 @@ public partial interface IVisionClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/Ideogram/Generated/Ideogram.IdeogramApi.g.cs b/src/libs/Ideogram/Generated/Ideogram.IdeogramApi.g.cs index e23500d..9d7a6b7 100644 --- a/src/libs/Ideogram/Generated/Ideogram.IdeogramApi.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.IdeogramApi.g.cs @@ -26,6 +26,11 @@ public sealed partial class IdeogramApi : global::Ideogram.IIdeogramApi, global: /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// @@ -37,6 +42,7 @@ public sealed partial class IdeogramApi : global::Ideogram.IIdeogramApi, global: /// public GenerateClient Generate => new GenerateClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -45,6 +51,7 @@ public sealed partial class IdeogramApi : global::Ideogram.IIdeogramApi, global: /// public ManageClient Manage => new ManageClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -53,6 +60,7 @@ public sealed partial class IdeogramApi : global::Ideogram.IIdeogramApi, global: /// public VisionClient Vision => new VisionClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -61,6 +69,7 @@ public sealed partial class IdeogramApi : global::Ideogram.IIdeogramApi, global: /// public InternalTestingClient InternalTesting => new InternalTestingClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; diff --git a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.PostInternalTesting.g.cs b/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.PostInternalTesting.g.cs index 8a2c9b5..21b43cf 100644 --- a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.PostInternalTesting.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.PostInternalTesting.g.cs @@ -27,7 +27,7 @@ partial void ProcessPostInternalTestingResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task PostInternalTestingAsync( global::Ideogram.InternalTestingRequest request, global::System.Threading.CancellationToken cancellationToken = default) @@ -157,29 +157,70 @@ partial void ProcessPostInternalTestingResponseContent( httpClient: HttpClient, httpResponseMessage: __response); - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + if (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostInternalTestingResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPostInternalTestingResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); - try - { - __response.EnsureSuccessStatusCode(); + 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), + }; + } + + return + global::Ideogram.PostInternalTesting200Response.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + 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 __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - return - global::Ideogram.PostInternalTesting200Response.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + var __responseValue = await global::Ideogram.PostInternalTesting200Response.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.g.cs index 40f7be9..5b0e57d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.InternalTestingClient.g.cs @@ -26,6 +26,11 @@ public sealed partial class InternalTestingClient : global::Ideogram.IInternalTe /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKey.g.cs index 825e67b..6b21566 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKey.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.CreateApiKey.g.cs @@ -23,7 +23,7 @@ partial void ProcessCreateApiKeyResponseContent( /// Creates an API key. /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task CreateApiKeyAsync( global::System.Threading.CancellationToken cancellationToken = default) { @@ -74,30 +74,119 @@ partial void ProcessCreateApiKeyResponseContent( ProcessCreateApiKeyResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + throw new global::Ideogram.ApiException( + message: __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 == 402) + { + string? __content_402 = null; + if (ReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_402 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateApiKeyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_402, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateApiKeyResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.PostApiKeyResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + 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), + }; + } - return - global::Ideogram.PostApiKeyResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::Ideogram.PostApiKeyResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs index 0acf2a7..4f568aa 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.DeleteSingleApiKey.g.cs @@ -21,7 +21,7 @@ partial void ProcessDeleteSingleApiKeyResponse( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task DeleteSingleApiKeyAsync( string apiKeyId, global::System.Threading.CancellationToken cancellationToken = default) @@ -75,7 +75,23 @@ partial void ProcessDeleteSingleApiKeyResponse( ProcessDeleteSingleApiKeyResponse( httpClient: HttpClient, httpResponseMessage: __response); - __response.EnsureSuccessStatusCode(); + 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), + }; + } } } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeys.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeys.g.cs index c6c54e9..a89e555 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeys.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiKeys.g.cs @@ -23,7 +23,7 @@ partial void ProcessGetApiKeysResponseContent( /// Retrieve current API keys and their respective data. /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task GetApiKeysAsync( global::System.Threading.CancellationToken cancellationToken = default) { @@ -74,30 +74,119 @@ partial void ProcessGetApiKeysResponseContent( ProcessGetApiKeysResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + throw new global::Ideogram.ApiException( + message: __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); + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiKeysResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetApiKeysResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.GetApiKeysResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + 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), + }; + } - return - global::Ideogram.GetApiKeysResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::Ideogram.GetApiKeysResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiStripeSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiStripeSubscription.g.cs index 8032664..742117c 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiStripeSubscription.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiStripeSubscription.g.cs @@ -26,7 +26,7 @@ partial void ProcessGetApiStripeSubscriptionResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task GetApiStripeSubscriptionAsync( bool? isBusiness = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -83,30 +83,119 @@ partial void ProcessGetApiStripeSubscriptionResponseContent( ProcessGetApiStripeSubscriptionResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + throw new global::Ideogram.ApiException( + message: __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); + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiStripeSubscriptionResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetApiStripeSubscriptionResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.ManageApiStripeSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + 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), + }; + } - return - global::Ideogram.ManageApiStripeSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::Ideogram.ManageApiStripeSubscriptionResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiSubscription.g.cs index 3c636c1..b843520 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiSubscription.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiSubscription.g.cs @@ -23,7 +23,7 @@ partial void ProcessGetApiSubscriptionResponseContent( /// Retrieve data relevant to creating an API subscription. /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task GetApiSubscriptionAsync( global::System.Threading.CancellationToken cancellationToken = default) { @@ -74,30 +74,119 @@ partial void ProcessGetApiSubscriptionResponseContent( ProcessGetApiSubscriptionResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + throw new global::Ideogram.ApiException( + message: __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); + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiSubscriptionResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetApiSubscriptionResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.ManageApiSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + 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), + }; + } - return - global::Ideogram.ManageApiSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::Ideogram.ManageApiSubscriptionResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiTerms.g.cs index ef6e61a..53a65c3 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiTerms.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.GetApiTerms.g.cs @@ -23,7 +23,7 @@ partial void ProcessGetApiTermsResponseContent( /// Retrieve the latest terms of service for API usage. /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task GetApiTermsAsync( global::System.Threading.CancellationToken cancellationToken = default) { @@ -74,30 +74,119 @@ partial void ProcessGetApiTermsResponseContent( ProcessGetApiTermsResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + throw new global::Ideogram.ApiException( + message: __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); + } - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiTermsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetApiTermsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.GetApiTermsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + 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), + }; + } - return - global::Ideogram.GetApiTermsResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::Ideogram.GetApiTermsResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiSubscription.g.cs index f18164d..48d5143 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiSubscription.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiSubscription.g.cs @@ -26,7 +26,7 @@ partial void ProcessPostApiSubscriptionResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task PostApiSubscriptionAsync( global::Ideogram.PostApiSubscriptionRequest request, global::System.Threading.CancellationToken cancellationToken = default) @@ -88,30 +88,147 @@ partial void ProcessPostApiSubscriptionResponseContent( ProcessPostApiSubscriptionResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Bad request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::Ideogram.PostApiSubscriptionError? __value_400 = null; + if (ReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_400 = global::Ideogram.PostApiSubscriptionError.FromJson(__content_400, JsonSerializerContext); + } + else + { + var __contentStream_400 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_400 = await global::Ideogram.PostApiSubscriptionError.FromJsonStreamAsync(__contentStream_400, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostApiSubscriptionResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + 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); + } - try + throw new global::Ideogram.ApiException( + message: __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) { - __response.EnsureSuccessStatusCode(); + 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: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; } - catch (global::System.Net.Http.HttpRequestException __ex) + + if (ReadResponseAsString) { - throw new global::System.InvalidOperationException(__content, __ex); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPostApiSubscriptionResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.PostApiSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } + 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 __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - return - global::Ideogram.PostApiSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + var __responseValue = await global::Ideogram.PostApiSubscriptionResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs index a226f6a..018e452 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.PostApiTerms.g.cs @@ -21,7 +21,7 @@ partial void ProcessPostApiTermsResponse( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task PostApiTermsAsync( global::Ideogram.PostApiTermsRequest request, global::System.Threading.CancellationToken cancellationToken = default) @@ -83,7 +83,23 @@ partial void ProcessPostApiTermsResponse( ProcessPostApiTermsResponse( httpClient: HttpClient, httpResponseMessage: __response); - __response.EnsureSuccessStatusCode(); + 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), + }; + } } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.ReactivateSubscription.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.ReactivateSubscription.g.cs index ca2f14c..fbf4447 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.ReactivateSubscription.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.ReactivateSubscription.g.cs @@ -23,7 +23,7 @@ partial void ProcessReactivateSubscriptionResponseContent( /// Reactivates a subscription by attempting to re-enable Metronome billing. /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task ReactivateSubscriptionAsync( global::System.Threading.CancellationToken cancellationToken = default) { @@ -74,30 +74,143 @@ partial void ProcessReactivateSubscriptionResponseContent( ProcessReactivateSubscriptionResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessReactivateSubscriptionResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __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 == 402) + { + string? __content_402 = null; + if (ReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_402 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } - try + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_402, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) { - __response.EnsureSuccessStatusCode(); + string? __content_404 = null; + if (ReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; } - catch (global::System.Net.Http.HttpRequestException __ex) + + if (ReadResponseAsString) { - throw new global::System.InvalidOperationException(__content, __ex); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessReactivateSubscriptionResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.PostApiReactivateResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } + 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 __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - return - global::Ideogram.PostApiReactivateResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + var __responseValue = await global::Ideogram.PostApiReactivateResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.ManageClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.ManageClient.g.cs index a671eec..c577d6c 100644 --- a/src/libs/Ideogram/Generated/Ideogram.ManageClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.ManageClient.g.cs @@ -26,6 +26,11 @@ public sealed partial class ManageClient : global::Ideogram.IManageClient, globa /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.Json.g.cs new file mode 100644 index 0000000..5bddeae --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ApiTerms + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ApiTerms? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ApiTerms), + jsonSerializerContext) as global::Ideogram.ApiTerms; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ApiTerms? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ApiTerms), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ApiTerms; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.g.cs index a505f95..8a65bfd 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ApiTerms.g.cs @@ -28,91 +28,29 @@ public sealed partial class ApiTerms [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ApiTerms? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ApiTerms), - jsonSerializerContext) as global::Ideogram.ApiTerms; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ApiTerms? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The ID of the terms. + /// + /// + /// The URL where the terms are hosted. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ApiTerms( + string termsId, + string termsUrl) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ApiTerms), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ApiTerms; + this.TermsId = termsId ?? throw new global::System.ArgumentNullException(nameof(termsId)); + this.TermsUrl = termsUrl ?? throw new global::System.ArgumentNullException(nameof(termsUrl)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ApiTerms() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.Json.g.cs new file mode 100644 index 0000000..13934e1 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ColorPaletteMember + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ColorPaletteMember? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ColorPaletteMember), + jsonSerializerContext) as global::Ideogram.ColorPaletteMember; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ColorPaletteMember? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ColorPaletteMember), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorPaletteMember; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs index b5ba262..7508c4e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs @@ -12,6 +12,7 @@ public sealed partial class ColorPaletteMember /// The hexadecimal representation of the color with an optional chosen weight
/// Example: #FFFFFF /// + /// #FFFFFF [global::System.Text.Json.Serialization.JsonPropertyName("color_hex")] [global::System.Text.Json.Serialization.JsonRequired] public required string ColorHex { get; set; } @@ -20,6 +21,7 @@ public sealed partial class ColorPaletteMember /// The weight of the color in the color palette.
/// Example: 0.25 /// + /// 0.25 [global::System.Text.Json.Serialization.JsonPropertyName("color_weight")] public double? ColorWeight { get; set; } @@ -29,91 +31,31 @@ public sealed partial class ColorPaletteMember [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ColorPaletteMember? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ColorPaletteMember), - jsonSerializerContext) as global::Ideogram.ColorPaletteMember; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ColorPaletteMember? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The hexadecimal representation of the color with an optional chosen weight
+ /// Example: #FFFFFF + /// + /// + /// The weight of the color in the color palette.
+ /// Example: 0.25 + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ColorPaletteMember( + string colorHex, + double? colorWeight) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ColorPaletteMember), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorPaletteMember; + this.ColorHex = colorHex ?? throw new global::System.ArgumentNullException(nameof(colorHex)); + this.ColorWeight = colorWeight; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ColorPaletteMember() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.Json.g.cs new file mode 100644 index 0000000..1d64637 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ColorPaletteWithMembers + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ColorPaletteWithMembers? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ColorPaletteWithMembers), + jsonSerializerContext) as global::Ideogram.ColorPaletteWithMembers; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ColorPaletteWithMembers? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ColorPaletteWithMembers), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorPaletteWithMembers; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs index a89892b..5cbeb73 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs @@ -21,91 +21,24 @@ public sealed partial class ColorPaletteWithMembers [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ColorPaletteWithMembers? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ColorPaletteWithMembers), - jsonSerializerContext) as global::Ideogram.ColorPaletteWithMembers; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ColorPaletteWithMembers? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A list of ColorPaletteMembers that define the color palette. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ColorPaletteWithMembers( + global::System.Collections.Generic.IList members) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ColorPaletteWithMembers), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorPaletteWithMembers; + this.Members = members ?? throw new global::System.ArgumentNullException(nameof(members)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ColorPaletteWithMembers() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.Json.g.cs new file mode 100644 index 0000000..c721d37 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ColorPaletteWithPresetName + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ColorPaletteWithPresetName? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ColorPaletteWithPresetName), + jsonSerializerContext) as global::Ideogram.ColorPaletteWithPresetName; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ColorPaletteWithPresetName? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ColorPaletteWithPresetName), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorPaletteWithPresetName; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs index c75b25e..e341e76 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs @@ -12,6 +12,7 @@ public sealed partial class ColorPaletteWithPresetName /// A color palette preset value
/// Example: PASTEL /// + /// PASTEL [global::System.Text.Json.Serialization.JsonPropertyName("name")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPalettePresetNameJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] @@ -23,91 +24,25 @@ public sealed partial class ColorPaletteWithPresetName [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ColorPaletteWithPresetName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ColorPaletteWithPresetName), - jsonSerializerContext) as global::Ideogram.ColorPaletteWithPresetName; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ColorPaletteWithPresetName? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A color palette preset value
+ /// Example: PASTEL + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ColorPaletteWithPresetName( + global::Ideogram.ColorPalettePresetName name) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ColorPaletteWithPresetName), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorPaletteWithPresetName; + this.Name = name; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ColorPaletteWithPresetName() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.Json.g.cs new file mode 100644 index 0000000..f798910 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public readonly partial struct ColorPaletteWithPresetNameOrMembers + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ColorPaletteWithPresetNameOrMembers? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers), + jsonSerializerContext) as global::Ideogram.ColorPaletteWithPresetNameOrMembers?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ColorPaletteWithPresetNameOrMembers? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorPaletteWithPresetNameOrMembers?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs index 4c665ff..e82de73 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs @@ -1,4 +1,3 @@ -using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete #nullable enable @@ -173,7 +172,8 @@ public override int GetHashCode() static int HashCodeAggregator(int hashCode, object? value) => value == null ? (hashCode ^ 0) * prime : (hashCode ^ value.GetHashCode()) * prime; - return fields.Aggregate(offset, HashCodeAggregator); + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); } /// @@ -210,92 +210,5 @@ public override bool Equals(object? obj) { return obj is ColorPaletteWithPresetNameOrMembers o && Equals(o); } - - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ColorPaletteWithPresetNameOrMembers? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers), - jsonSerializerContext) as global::Ideogram.ColorPaletteWithPresetNameOrMembers?; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ColorPaletteWithPresetNameOrMembers? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ColorPaletteWithPresetNameOrMembers), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ColorPaletteWithPresetNameOrMembers?; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.Json.g.cs new file mode 100644 index 0000000..02bf07d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class DescribeRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.DescribeRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.DescribeRequest), + jsonSerializerContext) as global::Ideogram.DescribeRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.DescribeRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.DescribeRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DescribeRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.g.cs index a4e224e..c2cc402 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeRequest.g.cs @@ -28,91 +28,25 @@ public sealed partial class DescribeRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::Ideogram.DescribeRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DescribeRequest( + byte[] imageFile, + string imageFilename) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DescribeRequest), - jsonSerializerContext) as global::Ideogram.DescribeRequest; + this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); + this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DescribeRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public DescribeRequest() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DescribeRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DescribeRequest; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.Json.g.cs new file mode 100644 index 0000000..d2d5aff --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class DescribeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.DescribeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.DescribeResponse), + jsonSerializerContext) as global::Ideogram.DescribeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.DescribeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.DescribeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DescribeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.g.cs index 7c9f774..d5c1b45 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DescribeResponse.g.cs @@ -20,91 +20,24 @@ public sealed partial class DescribeResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.DescribeResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.DescribeResponse), - jsonSerializerContext) as global::Ideogram.DescribeResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.DescribeResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A collection of descriptions for given content + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DescribeResponse( + global::System.Collections.Generic.IList? descriptions) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.DescribeResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DescribeResponse; + this.Descriptions = descriptions; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public DescribeResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Description.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Description.Json.g.cs new file mode 100644 index 0000000..7ec7449 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.Description.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class Description + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.Description? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.Description), + jsonSerializerContext) as global::Ideogram.Description; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.Description? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.Description), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.Description; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Description.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Description.g.cs index 38a89c0..d2859e0 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Description.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.Description.g.cs @@ -12,6 +12,7 @@ public sealed partial class Description /// The generated description for the provided image.
/// Example: A meticulously illustrated cat with striped patterns, sitting upright. The cat's eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image. ///
+ /// A meticulously illustrated cat with striped patterns, sitting upright. The cat's eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image. [global::System.Text.Json.Serialization.JsonPropertyName("text")] public string? Text { get; set; } @@ -21,91 +22,25 @@ public sealed partial class Description [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.Description? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.Description), - jsonSerializerContext) as global::Ideogram.Description; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.Description? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The generated description for the provided image.
+ /// Example: A meticulously illustrated cat with striped patterns, sitting upright. The cat's eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Description( + string? text) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.Description), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.Description; + this.Text = text; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public Description() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.Json.g.cs new file mode 100644 index 0000000..30da179 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class EditImageRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.EditImageRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.EditImageRequest), + jsonSerializerContext) as global::Ideogram.EditImageRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.EditImageRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.EditImageRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditImageRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.g.cs index 6d43c75..0653025 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.EditImageRequest.g.cs @@ -40,6 +40,7 @@ public sealed partial class EditImageRequest /// The prompt used to describe the edited result.
/// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. /// + /// A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] [global::System.Text.Json.Serialization.JsonRequired] public required string Prompt { get; set; } @@ -49,6 +50,8 @@ public sealed partial class EditImageRequest /// Default Value: V_2
/// Example: V_2_TURBO /// + /// global::Ideogram.ModelEnum.V2 + /// V_2_TURBO [global::System.Text.Json.Serialization.JsonPropertyName("model")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelEnumJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] @@ -59,6 +62,7 @@ public sealed partial class EditImageRequest /// Default Value: AUTO
/// Example: ON /// + /// ON [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_option")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; } @@ -66,6 +70,7 @@ public sealed partial class EditImageRequest /// /// Example: 12345 /// + /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -73,6 +78,7 @@ public sealed partial class EditImageRequest /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
/// Example: REALISTIC /// + /// REALISTIC [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeJsonConverter))] public global::Ideogram.StyleType? StyleType { get; set; } @@ -83,91 +89,70 @@ public sealed partial class EditImageRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.EditImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.EditImageRequest), - jsonSerializerContext) as global::Ideogram.EditImageRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.EditImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The image being edited; only JPEG, WEBPs and PNGs are supported at this time + /// + /// + /// The image being edited; only JPEG, WEBPs and PNGs are supported at this time + /// + /// + /// A black and white image of the same size as the image being edited. Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WEBPs and PNGs are supported at this time + /// + /// + /// A black and white image of the same size as the image being edited. Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WEBPs and PNGs are supported at this time + /// + /// + /// The prompt used to describe the edited result.
+ /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. + /// + /// + /// The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
+ /// Default Value: V_2
+ /// Example: V_2_TURBO + /// + /// + /// Determine if MagicPrompt should be used in generating the request or not
+ /// Default Value: AUTO
+ /// Example: ON + /// + /// + /// Example: 12345 + /// + /// + /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
+ /// Example: REALISTIC + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EditImageRequest( + byte[] imageFile, + string imageFilename, + byte[] mask, + string maskname, + string prompt, + global::Ideogram.ModelEnum model, + global::Ideogram.MagicPromptOption? magicPromptOption, + int? seed, + global::Ideogram.StyleType? styleType) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.EditImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.EditImageRequest; + this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); + this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename)); + this.Mask = mask ?? throw new global::System.ArgumentNullException(nameof(mask)); + this.Maskname = maskname ?? throw new global::System.ArgumentNullException(nameof(maskname)); + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Model = model; + this.MagicPromptOption = magicPromptOption; + this.Seed = seed; + this.StyleType = styleType; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public EditImageRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.Json.g.cs new file mode 100644 index 0000000..c32c075 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerateImageRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerateImageRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerateImageRequest), + jsonSerializerContext) as global::Ideogram.GenerateImageRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerateImageRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerateImageRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.g.cs index f801589..db06640 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.g.cs @@ -21,91 +21,22 @@ public sealed partial class GenerateImageRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::Ideogram.GenerateImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GenerateImageRequest( + global::Ideogram.ImageRequest imageRequest) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageRequest), - jsonSerializerContext) as global::Ideogram.GenerateImageRequest; + this.ImageRequest = imageRequest ?? throw new global::System.ArgumentNullException(nameof(imageRequest)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public GenerateImageRequest() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageRequest; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.Json.g.cs new file mode 100644 index 0000000..071a15c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerateImageResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerateImageResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerateImageResponse), + jsonSerializerContext) as global::Ideogram.GenerateImageResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerateImageResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerateImageResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.g.cs index a2097ce..7d04d3e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageResponse.g.cs @@ -29,91 +29,29 @@ public sealed partial class GenerateImageResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageResponse), - jsonSerializerContext) as global::Ideogram.GenerateImageResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The time the request was created. + /// + /// + /// A list of ImageObjects that contain the generated image(s). + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GenerateImageResponse( + global::System.DateTime created, + global::System.Collections.Generic.IList data) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageResponse; + this.Created = created; + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public GenerateImageResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.Json.g.cs new file mode 100644 index 0000000..d641c3d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GenerateImageSafetyError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GenerateImageSafetyError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GenerateImageSafetyError), + jsonSerializerContext) as global::Ideogram.GenerateImageSafetyError; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GenerateImageSafetyError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GenerateImageSafetyError), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageSafetyError; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.g.cs index da7c99f..b44ddf1 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageSafetyError.g.cs @@ -11,6 +11,7 @@ public sealed partial class GenerateImageSafetyError /// /// Example: Prompt provided failed safety check due to the inclusion of prohibited content. /// + /// Prompt provided failed safety check due to the inclusion of prohibited content. [global::System.Text.Json.Serialization.JsonPropertyName("error")] [global::System.Text.Json.Serialization.JsonRequired] public required string Error { get; set; } @@ -21,91 +22,24 @@ public sealed partial class GenerateImageSafetyError [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GenerateImageSafetyError? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GenerateImageSafetyError), - jsonSerializerContext) as global::Ideogram.GenerateImageSafetyError; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GenerateImageSafetyError? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Example: Prompt provided failed safety check due to the inclusion of prohibited content. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GenerateImageSafetyError( + string error) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GenerateImageSafetyError), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GenerateImageSafetyError; + this.Error = error ?? throw new global::System.ArgumentNullException(nameof(error)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public GenerateImageSafetyError() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.Json.g.cs new file mode 100644 index 0000000..f179f83 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GetApiKeysResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GetApiKeysResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GetApiKeysResponse), + jsonSerializerContext) as global::Ideogram.GetApiKeysResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GetApiKeysResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GetApiKeysResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetApiKeysResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.g.cs index b96b357..f03ab01 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiKeysResponse.g.cs @@ -20,91 +20,24 @@ public sealed partial class GetApiKeysResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.GetApiKeysResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetApiKeysResponse), - jsonSerializerContext) as global::Ideogram.GetApiKeysResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetApiKeysResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The current API keys that are active. Only returns redacted keys. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetApiKeysResponse( + global::System.Collections.Generic.IList? currentApiKeys) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetApiKeysResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetApiKeysResponse; + this.CurrentApiKeys = currentApiKeys; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public GetApiKeysResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.Json.g.cs new file mode 100644 index 0000000..c8b2d14 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class GetApiTermsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.GetApiTermsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.GetApiTermsResponse), + jsonSerializerContext) as global::Ideogram.GetApiTermsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.GetApiTermsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.GetApiTermsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetApiTermsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.g.cs index 4d1506b..cc77871 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.GetApiTermsResponse.g.cs @@ -21,91 +21,22 @@ public sealed partial class GetApiTermsResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::Ideogram.GetApiTermsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetApiTermsResponse( + global::Ideogram.ApiTerms apiTerms) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.GetApiTermsResponse), - jsonSerializerContext) as global::Ideogram.GetApiTermsResponse; + this.ApiTerms = apiTerms ?? throw new global::System.ArgumentNullException(nameof(apiTerms)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.GetApiTermsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public GetApiTermsResponse() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.GetApiTermsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.GetApiTermsResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.Json.g.cs new file mode 100644 index 0000000..a9b06ee --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageObject), + jsonSerializerContext) as global::Ideogram.ImageObject; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageObject; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.g.cs index 4537f8d..dbb918c 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageObject.g.cs @@ -12,6 +12,7 @@ public sealed partial class ImageObject /// The direct link to the image generated.
/// Example: https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g /// + /// https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g [global::System.Text.Json.Serialization.JsonPropertyName("url")] public string? Url { get; set; } @@ -19,6 +20,7 @@ public sealed partial class ImageObject /// The prompt used for the generation. This may be different from the original prompt.
/// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. /// + /// A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] [global::System.Text.Json.Serialization.JsonRequired] public required string Prompt { get; set; } @@ -27,6 +29,7 @@ public sealed partial class ImageObject /// The resolution of the final image.
/// Example: 1024x1024 /// + /// 1024x1024 [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] [global::System.Text.Json.Serialization.JsonRequired] public required string Resolution { get; set; } @@ -41,6 +44,7 @@ public sealed partial class ImageObject /// /// Example: 12345 /// + /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] [global::System.Text.Json.Serialization.JsonRequired] public required int Seed { get; set; } @@ -49,6 +53,7 @@ public sealed partial class ImageObject /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
/// Example: REALISTIC /// + /// REALISTIC [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeJsonConverter))] public global::Ideogram.StyleType? StyleType { get; set; } @@ -59,91 +64,53 @@ public sealed partial class ImageObject [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageObject), - jsonSerializerContext) as global::Ideogram.ImageObject; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The direct link to the image generated.
+ /// Example: https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g + /// + /// + /// The prompt used for the generation. This may be different from the original prompt.
+ /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. + /// + /// + /// The resolution of the final image.
+ /// Example: 1024x1024 + /// + /// + /// Whether this request passes safety checks. If false, the url field will be empty. + /// + /// + /// Example: 12345 + /// + /// + /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
+ /// Example: REALISTIC + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ImageObject( + string prompt, + string resolution, + bool isImageSafe, + int seed, + string? url, + global::Ideogram.StyleType? styleType) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageObject; + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.Resolution = resolution ?? throw new global::System.ArgumentNullException(nameof(resolution)); + this.IsImageSafe = isImageSafe; + this.Seed = seed; + this.Url = url; + this.StyleType = styleType; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ImageObject() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.Json.g.cs new file mode 100644 index 0000000..367241b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageRequest), + jsonSerializerContext) as global::Ideogram.ImageRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs index 76ac824..796fada 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs @@ -12,6 +12,7 @@ public sealed partial class ImageRequest /// The prompt to use to generate the image.
/// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. /// + /// A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] [global::System.Text.Json.Serialization.JsonRequired] public required string Prompt { get; set; } @@ -20,6 +21,7 @@ public sealed partial class ImageRequest /// (Cannot be used in conjunction with resolution) The aspect ratio to use for image generation, which determines the image's resolution. Defaults to ASPECT_1_1.
/// Example: ASPECT_10_16 /// + /// ASPECT_10_16 [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.AspectRatioJsonConverter))] public global::Ideogram.AspectRatio? AspectRatio { get; set; } @@ -29,6 +31,7 @@ public sealed partial class ImageRequest /// Default Value: V_2
/// Example: V_2_TURBO /// + /// V_2_TURBO [global::System.Text.Json.Serialization.JsonPropertyName("model")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ModelEnumJsonConverter))] public global::Ideogram.ModelEnum? Model { get; set; } @@ -38,6 +41,7 @@ public sealed partial class ImageRequest /// Default Value: AUTO
/// Example: ON /// + /// ON [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_option")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; } @@ -45,6 +49,7 @@ public sealed partial class ImageRequest /// /// Example: 12345 /// + /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -52,6 +57,7 @@ public sealed partial class ImageRequest /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
/// Example: REALISTIC /// + /// REALISTIC [global::System.Text.Json.Serialization.JsonPropertyName("style_type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.StyleTypeJsonConverter))] public global::Ideogram.StyleType? StyleType { get; set; } @@ -60,6 +66,7 @@ public sealed partial class ImageRequest /// Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.
/// Example: brush strokes, painting /// + /// brush strokes, painting [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] public string? NegativePrompt { get; set; } @@ -67,6 +74,7 @@ public sealed partial class ImageRequest /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
/// Example: RESOLUTION_1024_1024 /// + /// RESOLUTION_1024_1024 [global::System.Text.Json.Serialization.JsonPropertyName("resolution")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionJsonConverter))] public global::Ideogram.Resolution? Resolution { get; set; } @@ -84,91 +92,73 @@ public sealed partial class ImageRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageRequest), - jsonSerializerContext) as global::Ideogram.ImageRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The prompt to use to generate the image.
+ /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. + /// + /// + /// (Cannot be used in conjunction with resolution) The aspect ratio to use for image generation, which determines the image's resolution. Defaults to ASPECT_1_1.
+ /// Example: ASPECT_10_16 + /// + /// + /// The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
+ /// Default Value: V_2
+ /// Example: V_2_TURBO + /// + /// + /// Determine if MagicPrompt should be used in generating the request or not
+ /// Default Value: AUTO
+ /// Example: ON + /// + /// + /// Example: 12345 + /// + /// + /// The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
+ /// Example: REALISTIC + /// + /// + /// Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.
+ /// Example: brush strokes, painting + /// + /// + /// (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
+ /// Example: RESOLUTION_1024_1024 + /// + /// + /// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ImageRequest( + string prompt, + global::Ideogram.AspectRatio? aspectRatio, + global::Ideogram.ModelEnum? model, + global::Ideogram.MagicPromptOption? magicPromptOption, + int? seed, + global::Ideogram.StyleType? styleType, + string? negativePrompt, + global::Ideogram.Resolution? resolution, + global::Ideogram.ColorPaletteWithPresetNameOrMembers? colorPalette) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageRequest; + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.AspectRatio = aspectRatio; + this.Model = model; + this.MagicPromptOption = magicPromptOption; + this.Seed = seed; + this.StyleType = styleType; + this.NegativePrompt = negativePrompt; + this.Resolution = resolution; + this.ColorPalette = colorPalette; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ImageRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.Json.g.cs new file mode 100644 index 0000000..8239ee2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ImageSafetyError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ImageSafetyError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ImageSafetyError), + jsonSerializerContext) as global::Ideogram.ImageSafetyError; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ImageSafetyError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ImageSafetyError), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageSafetyError; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.g.cs index f066b74..3e9b287 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ImageSafetyError.g.cs @@ -11,6 +11,7 @@ public sealed partial class ImageSafetyError /// /// Example: Image provided failed safety check due to the inclusion of prohibited content. /// + /// Image provided failed safety check due to the inclusion of prohibited content. [global::System.Text.Json.Serialization.JsonPropertyName("error")] [global::System.Text.Json.Serialization.JsonRequired] public required string Error { get; set; } @@ -21,91 +22,24 @@ public sealed partial class ImageSafetyError [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ImageSafetyError? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ImageSafetyError), - jsonSerializerContext) as global::Ideogram.ImageSafetyError; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ImageSafetyError? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Example: Image provided failed safety check due to the inclusion of prohibited content. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ImageSafetyError( + string error) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ImageSafetyError), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ImageSafetyError; + this.Error = error ?? throw new global::System.ArgumentNullException(nameof(error)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ImageSafetyError() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.Json.g.cs new file mode 100644 index 0000000..e038f34 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class InitialImageRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.InitialImageRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.InitialImageRequest), + jsonSerializerContext) as global::Ideogram.InitialImageRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.InitialImageRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.InitialImageRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InitialImageRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.g.cs index b37f893..7e97540 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InitialImageRequest.g.cs @@ -12,6 +12,7 @@ public sealed partial class InitialImageRequest /// Default Value: 50
/// Example: 50 /// + /// 50 [global::System.Text.Json.Serialization.JsonPropertyName("image_weight")] public int? ImageWeight { get; set; } @@ -21,91 +22,25 @@ public sealed partial class InitialImageRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InitialImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InitialImageRequest), - jsonSerializerContext) as global::Ideogram.InitialImageRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InitialImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Default Value: 50
+ /// Example: 50 + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public InitialImageRequest( + int? imageWeight) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InitialImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InitialImageRequest; + this.ImageWeight = imageWeight; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public InitialImageRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.Json.g.cs new file mode 100644 index 0000000..28070dd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class InternalTestingNestedObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.InternalTestingNestedObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.InternalTestingNestedObject), + jsonSerializerContext) as global::Ideogram.InternalTestingNestedObject; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.InternalTestingNestedObject? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.InternalTestingNestedObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalTestingNestedObject; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.g.cs index 92be1af..ddee51b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObject.g.cs @@ -26,91 +26,25 @@ public sealed partial class InternalTestingNestedObject [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::Ideogram.InternalTestingNestedObject? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public InternalTestingNestedObject( + string? propOne, + string? propTwo) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InternalTestingNestedObject), - jsonSerializerContext) as global::Ideogram.InternalTestingNestedObject; + this.PropOne = propOne; + this.PropTwo = propTwo; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InternalTestingNestedObject? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public InternalTestingNestedObject() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InternalTestingNestedObject), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalTestingNestedObject; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.Json.g.cs new file mode 100644 index 0000000..ef49e8d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class InternalTestingNestedObjectRequiredFields + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.InternalTestingNestedObjectRequiredFields? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.InternalTestingNestedObjectRequiredFields), + jsonSerializerContext) as global::Ideogram.InternalTestingNestedObjectRequiredFields; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.InternalTestingNestedObjectRequiredFields? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.InternalTestingNestedObjectRequiredFields), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalTestingNestedObjectRequiredFields; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.g.cs index 3cb4f09..969a1dd 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingNestedObjectRequiredFields.g.cs @@ -28,91 +28,25 @@ public sealed partial class InternalTestingNestedObjectRequiredFields [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::Ideogram.InternalTestingNestedObjectRequiredFields? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public InternalTestingNestedObjectRequiredFields( + string propOne, + string propTwo) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InternalTestingNestedObjectRequiredFields), - jsonSerializerContext) as global::Ideogram.InternalTestingNestedObjectRequiredFields; + this.PropOne = propOne ?? throw new global::System.ArgumentNullException(nameof(propOne)); + this.PropTwo = propTwo ?? throw new global::System.ArgumentNullException(nameof(propTwo)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InternalTestingNestedObjectRequiredFields? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public InternalTestingNestedObjectRequiredFields() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InternalTestingNestedObjectRequiredFields), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalTestingNestedObjectRequiredFields; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.Json.g.cs new file mode 100644 index 0000000..2cce60b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class InternalTestingRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.InternalTestingRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.InternalTestingRequest), + jsonSerializerContext) as global::Ideogram.InternalTestingRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.InternalTestingRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.InternalTestingRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalTestingRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.g.cs index 6a2cf12..d083804 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.InternalTestingRequest.g.cs @@ -100,91 +100,61 @@ public sealed partial class InternalTestingRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.InternalTestingRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public InternalTestingRequest( + global::System.DateTime requiredDateTypeField, + int? xPosition, + byte[]? imageFile, + string? imageFilename, + byte[]? anotherImageFile, + string? anotherImageFilename, + string? someText, + global::Ideogram.InternalTestingNestedObject? nestedObject, + global::Ideogram.InternalTestingNestedObjectRequiredFields? nestedObjectRequiredFields, + global::System.DateTime? dateTypeField, + global::System.DateTime? dateTimeTypeField, + global::System.Collections.Generic.IList? repeatedPrimitiveField, + global::System.Collections.Generic.IList? repeatedComplexField, + global::Ideogram.InternalTestingEnumField? enumTypeField) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.InternalTestingRequest), - jsonSerializerContext) as global::Ideogram.InternalTestingRequest; + this.RequiredDateTypeField = requiredDateTypeField; + this.XPosition = xPosition; + this.ImageFile = imageFile; + this.ImageFilename = imageFilename; + this.AnotherImageFile = anotherImageFile; + this.AnotherImageFilename = anotherImageFilename; + this.SomeText = someText; + this.NestedObject = nestedObject; + this.NestedObjectRequiredFields = nestedObjectRequiredFields; + this.DateTypeField = dateTypeField; + this.DateTimeTypeField = dateTimeTypeField; + this.RepeatedPrimitiveField = repeatedPrimitiveField; + this.RepeatedComplexField = repeatedComplexField; + this.EnumTypeField = enumTypeField; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.InternalTestingRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public InternalTestingRequest() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.InternalTestingRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.InternalTestingRequest; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.Json.g.cs new file mode 100644 index 0000000..26118a2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ManageApiStripeSubscriptionResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ManageApiStripeSubscriptionResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ManageApiStripeSubscriptionResponse), + jsonSerializerContext) as global::Ideogram.ManageApiStripeSubscriptionResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ManageApiStripeSubscriptionResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ManageApiStripeSubscriptionResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ManageApiStripeSubscriptionResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.g.cs index 6ef28cb..cd29911 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiStripeSubscriptionResponse.g.cs @@ -27,91 +27,24 @@ public sealed partial class ManageApiStripeSubscriptionResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ManageApiStripeSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ManageApiStripeSubscriptionResponse), - jsonSerializerContext) as global::Ideogram.ManageApiStripeSubscriptionResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ManageApiStripeSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The URL for the user to checkout the Stripe subscription plan. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ManageApiStripeSubscriptionResponse( + string? stripeSubscriptionUrl) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ManageApiStripeSubscriptionResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ManageApiStripeSubscriptionResponse; + this.StripeSubscriptionUrl = stripeSubscriptionUrl; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ManageApiStripeSubscriptionResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.Json.g.cs new file mode 100644 index 0000000..e0b7048 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class ManageApiSubscriptionResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.ManageApiSubscriptionResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.ManageApiSubscriptionResponse), + jsonSerializerContext) as global::Ideogram.ManageApiSubscriptionResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.ManageApiSubscriptionResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.ManageApiSubscriptionResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ManageApiSubscriptionResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.g.cs index 39912bf..031dde4 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.ManageApiSubscriptionResponse.g.cs @@ -60,91 +60,40 @@ public sealed partial class ManageApiSubscriptionResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.ManageApiSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.ManageApiSubscriptionResponse), - jsonSerializerContext) as global::Ideogram.ManageApiSubscriptionResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.ManageApiSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Whether or not the latest required terms have been accepted. + /// + /// + /// Whether or not Stripe is setup for API usage. + /// + /// + /// + /// + /// The URL for the user to manage the existing Stripe subscription plan. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ManageApiSubscriptionResponse( + bool hasAcceptedTerms, + bool hasStripeSetup, + global::Ideogram.MetronomeLinks? metronomeLinks, + global::Ideogram.RechargeSettingsResponse? rechargeSettings, + string? stripeBillingUrl) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.ManageApiSubscriptionResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.ManageApiSubscriptionResponse; + this.HasAcceptedTerms = hasAcceptedTerms; + this.HasStripeSetup = hasStripeSetup; + this.MetronomeLinks = metronomeLinks; + this.RechargeSettings = rechargeSettings; + this.StripeBillingUrl = stripeBillingUrl; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ManageApiSubscriptionResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.Json.g.cs new file mode 100644 index 0000000..8d509bb --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class MetronomeLinks + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.MetronomeLinks? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.MetronomeLinks), + jsonSerializerContext) as global::Ideogram.MetronomeLinks; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.MetronomeLinks? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.MetronomeLinks), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MetronomeLinks; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.g.cs index f242c7f..6059c1c 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.MetronomeLinks.g.cs @@ -38,91 +38,39 @@ public sealed partial class MetronomeLinks [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.MetronomeLinks? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.MetronomeLinks), - jsonSerializerContext) as global::Ideogram.MetronomeLinks; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.MetronomeLinks? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The URL to display the customer invoice and API usage. + /// + /// + /// The URL to display the customer invoice and API usage. + /// + /// + /// The URL to display the customer invoice and API usage. + /// + /// + /// The URL to display the customer invoice and API usage. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public MetronomeLinks( + string? invoicesIframeUrl, + string? invoicesIframeDarkModeUrl, + string? creditsIframeUrl, + string? creditsIframeDarkModeUrl) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.MetronomeLinks), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.MetronomeLinks; + this.InvoicesIframeUrl = invoicesIframeUrl; + this.InvoicesIframeDarkModeUrl = invoicesIframeDarkModeUrl; + this.CreditsIframeUrl = creditsIframeUrl; + this.CreditsIframeDarkModeUrl = creditsIframeDarkModeUrl; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public MetronomeLinks() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.Json.g.cs new file mode 100644 index 0000000..f78dc3e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class PostApiKeyResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.PostApiKeyResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.PostApiKeyResponse), + jsonSerializerContext) as global::Ideogram.PostApiKeyResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.PostApiKeyResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.PostApiKeyResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiKeyResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.g.cs index 91082b8..20e8fcf 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiKeyResponse.g.cs @@ -12,6 +12,7 @@ public sealed partial class PostApiKeyResponse /// The API key to use when making authenticated requests with the API. This key will only be shown once.
/// Example: vkpDjaKdMNR8QJ83GjfNvFZJbnoi65XUp70MgZNtA2H9XE8yfDnmr_6BaRyQkF9hnJzu6mUPRLBmqlnZMwetJA /// + /// vkpDjaKdMNR8QJ83GjfNvFZJbnoi65XUp70MgZNtA2H9XE8yfDnmr_6BaRyQkF9hnJzu6mUPRLBmqlnZMwetJA [global::System.Text.Json.Serialization.JsonPropertyName("api_key")] [global::System.Text.Json.Serialization.JsonRequired] public required string ApiKey { get; set; } @@ -20,6 +21,7 @@ public sealed partial class PostApiKeyResponse /// The ID of the API key. A URL safe base64 encoded UUID
/// Example: JRPVD7jWR1aTBYiJ0UFVOg== /// + /// JRPVD7jWR1aTBYiJ0UFVOg== [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string ApiKeyId { get; set; } @@ -30,91 +32,31 @@ public sealed partial class PostApiKeyResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostApiKeyResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiKeyResponse), - jsonSerializerContext) as global::Ideogram.PostApiKeyResponse; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiKeyResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The API key to use when making authenticated requests with the API. This key will only be shown once.
+ /// Example: vkpDjaKdMNR8QJ83GjfNvFZJbnoi65XUp70MgZNtA2H9XE8yfDnmr_6BaRyQkF9hnJzu6mUPRLBmqlnZMwetJA + /// + /// + /// The ID of the API key. A URL safe base64 encoded UUID
+ /// Example: JRPVD7jWR1aTBYiJ0UFVOg== + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PostApiKeyResponse( + string apiKey, + string apiKeyId) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiKeyResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiKeyResponse; + this.ApiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + this.ApiKeyId = apiKeyId ?? throw new global::System.ArgumentNullException(nameof(apiKeyId)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public PostApiKeyResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiReactivateResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiReactivateResponse.Json.g.cs new file mode 100644 index 0000000..aaf7b88 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiReactivateResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class PostApiReactivateResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.PostApiReactivateResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.PostApiReactivateResponse), + jsonSerializerContext) as global::Ideogram.PostApiReactivateResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.PostApiReactivateResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.PostApiReactivateResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiReactivateResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiReactivateResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiReactivateResponse.g.cs index 787e15f..216597b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiReactivateResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiReactivateResponse.g.cs @@ -20,91 +20,22 @@ public sealed partial class PostApiReactivateResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::Ideogram.PostApiReactivateResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PostApiReactivateResponse( + global::Ideogram.RechargeSettingsResponse? rechargeSettings) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiReactivateResponse), - jsonSerializerContext) as global::Ideogram.PostApiReactivateResponse; + this.RechargeSettings = rechargeSettings; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiReactivateResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public PostApiReactivateResponse() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiReactivateResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiReactivateResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.Json.g.cs new file mode 100644 index 0000000..724ea49 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class PostApiSubscriptionError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.PostApiSubscriptionError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.PostApiSubscriptionError), + jsonSerializerContext) as global::Ideogram.PostApiSubscriptionError; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.PostApiSubscriptionError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.PostApiSubscriptionError), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiSubscriptionError; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.g.cs index 2125062..9e166eb 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionError.g.cs @@ -20,91 +20,24 @@ public sealed partial class PostApiSubscriptionError [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostApiSubscriptionError? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiSubscriptionError), - jsonSerializerContext) as global::Ideogram.PostApiSubscriptionError; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiSubscriptionError? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Error messages about what the error could be. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PostApiSubscriptionError( + global::System.Collections.Generic.IList? messages) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiSubscriptionError), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiSubscriptionError; + this.Messages = messages; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public PostApiSubscriptionError() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.Json.g.cs new file mode 100644 index 0000000..ddb41b9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class PostApiSubscriptionRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.PostApiSubscriptionRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.PostApiSubscriptionRequest), + jsonSerializerContext) as global::Ideogram.PostApiSubscriptionRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.PostApiSubscriptionRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.PostApiSubscriptionRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiSubscriptionRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.g.cs index 4b07ac0..caf940e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionRequest.g.cs @@ -20,91 +20,24 @@ public sealed partial class PostApiSubscriptionRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostApiSubscriptionRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiSubscriptionRequest), - jsonSerializerContext) as global::Ideogram.PostApiSubscriptionRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiSubscriptionRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The current recharge settings for the API subscription. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PostApiSubscriptionRequest( + global::Ideogram.RechargeSettings? rechargeSettings) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiSubscriptionRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiSubscriptionRequest; + this.RechargeSettings = rechargeSettings; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public PostApiSubscriptionRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.Json.g.cs new file mode 100644 index 0000000..0dbfbce --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class PostApiSubscriptionResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.PostApiSubscriptionResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.PostApiSubscriptionResponse), + jsonSerializerContext) as global::Ideogram.PostApiSubscriptionResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.PostApiSubscriptionResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.PostApiSubscriptionResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiSubscriptionResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.g.cs index 1f9bacf..c0c1218 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiSubscriptionResponse.g.cs @@ -20,91 +20,22 @@ public sealed partial class PostApiSubscriptionResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::Ideogram.PostApiSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PostApiSubscriptionResponse( + global::Ideogram.RechargeSettingsResponse? rechargeSettings) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiSubscriptionResponse), - jsonSerializerContext) as global::Ideogram.PostApiSubscriptionResponse; + this.RechargeSettings = rechargeSettings; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiSubscriptionResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public PostApiSubscriptionResponse() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiSubscriptionResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiSubscriptionResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.Json.g.cs new file mode 100644 index 0000000..0302629 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class PostApiTermsRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.PostApiTermsRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.PostApiTermsRequest), + jsonSerializerContext) as global::Ideogram.PostApiTermsRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.PostApiTermsRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.PostApiTermsRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiTermsRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.g.cs index 0f70e7c..b0ad67a 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostApiTermsRequest.g.cs @@ -12,6 +12,7 @@ public sealed partial class PostApiTermsRequest /// The ID of the terms which are being accepted.
/// Example: TOS_2024_04_20 /// + /// TOS_2024_04_20 [global::System.Text.Json.Serialization.JsonPropertyName("terms_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string TermsId { get; set; } @@ -22,91 +23,25 @@ public sealed partial class PostApiTermsRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.PostApiTermsRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostApiTermsRequest), - jsonSerializerContext) as global::Ideogram.PostApiTermsRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostApiTermsRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The ID of the terms which are being accepted.
+ /// Example: TOS_2024_04_20 + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PostApiTermsRequest( + string termsId) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostApiTermsRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostApiTermsRequest; + this.TermsId = termsId ?? throw new global::System.ArgumentNullException(nameof(termsId)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public PostApiTermsRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.Json.g.cs new file mode 100644 index 0000000..57f3575 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class PostInternalTesting200Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.PostInternalTesting200Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.PostInternalTesting200Response), + jsonSerializerContext) as global::Ideogram.PostInternalTesting200Response; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.PostInternalTesting200Response? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.PostInternalTesting200Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostInternalTesting200Response; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.g.cs index c88e310..36a1c4b 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.PostInternalTesting200Response.g.cs @@ -20,91 +20,22 @@ public sealed partial class PostInternalTesting200Response [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::Ideogram.PostInternalTesting200Response? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PostInternalTesting200Response( + string? responseContent) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.PostInternalTesting200Response), - jsonSerializerContext) as global::Ideogram.PostInternalTesting200Response; + this.ResponseContent = responseContent; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.PostInternalTesting200Response? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public PostInternalTesting200Response() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.PostInternalTesting200Response), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.PostInternalTesting200Response; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Price.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Price.Json.g.cs new file mode 100644 index 0000000..fb0f19b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.Price.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class Price + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.Price? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.Price), + jsonSerializerContext) as global::Ideogram.Price; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.Price? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.Price), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.Price; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.Price.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.Price.g.cs index f19210c..1bce1bd 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.Price.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.Price.g.cs @@ -12,6 +12,7 @@ public sealed partial class Price /// The ISO 4217 currency code for the price object.
/// Example: USD /// + /// USD [global::System.Text.Json.Serialization.JsonPropertyName("currency_code")] [global::System.Text.Json.Serialization.JsonRequired] public required string CurrencyCode { get; set; } @@ -20,6 +21,7 @@ public sealed partial class Price /// The amount of the currency in the common denomination. For example, in USD this is cents.
/// Example: 1050 /// + /// 1050 [global::System.Text.Json.Serialization.JsonPropertyName("amount")] [global::System.Text.Json.Serialization.JsonRequired] public required double Amount { get; set; } @@ -30,91 +32,31 @@ public sealed partial class Price [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.Price? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.Price), - jsonSerializerContext) as global::Ideogram.Price; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.Price? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The ISO 4217 currency code for the price object.
+ /// Example: USD + /// + /// + /// The amount of the currency in the common denomination. For example, in USD this is cents.
+ /// Example: 1050 + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Price( + string currencyCode, + double amount) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.Price), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.Price; + this.CurrencyCode = currencyCode ?? throw new global::System.ArgumentNullException(nameof(currencyCode)); + this.Amount = amount; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public Price() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.Json.g.cs new file mode 100644 index 0000000..d9ff171 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class RechargeSettings + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.RechargeSettings? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.RechargeSettings), + jsonSerializerContext) as global::Ideogram.RechargeSettings; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.RechargeSettings? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.RechargeSettings), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RechargeSettings; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.g.cs index a2d6db2..8c6f2cc 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettings.g.cs @@ -28,91 +28,29 @@ public sealed partial class RechargeSettings [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RechargeSettings? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RechargeSettings), - jsonSerializerContext) as global::Ideogram.RechargeSettings; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RechargeSettings? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Represents a price. + /// + /// + /// Represents a price. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RechargeSettings( + global::Ideogram.Price topUpBalance, + global::Ideogram.Price minimumBalanceThreshold) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RechargeSettings), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RechargeSettings; + this.TopUpBalance = topUpBalance ?? throw new global::System.ArgumentNullException(nameof(topUpBalance)); + this.MinimumBalanceThreshold = minimumBalanceThreshold ?? throw new global::System.ArgumentNullException(nameof(minimumBalanceThreshold)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public RechargeSettings() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.Json.g.cs new file mode 100644 index 0000000..52552d6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class RechargeSettingsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.RechargeSettingsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.RechargeSettingsResponse), + jsonSerializerContext) as global::Ideogram.RechargeSettingsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.RechargeSettingsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.RechargeSettingsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RechargeSettingsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.g.cs index 65ce04f..c12818e 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RechargeSettingsResponse.g.cs @@ -21,91 +21,24 @@ public sealed partial class RechargeSettingsResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RechargeSettingsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RechargeSettingsResponse), - jsonSerializerContext) as global::Ideogram.RechargeSettingsResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RechargeSettingsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Whether or not the recharge setting is currently active. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RechargeSettingsResponse( + bool isActive) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RechargeSettingsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RechargeSettingsResponse; + this.IsActive = isActive; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public RechargeSettingsResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.Json.g.cs new file mode 100644 index 0000000..46d739b --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class RedactedApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.RedactedApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.RedactedApiKey), + jsonSerializerContext) as global::Ideogram.RedactedApiKey; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.RedactedApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.RedactedApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RedactedApiKey; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.g.cs index 8950527..766a470 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RedactedApiKey.g.cs @@ -12,6 +12,7 @@ public sealed partial class RedactedApiKey /// A redacted text snippet of the API key. Contains the first 4 characters of the API key
/// Example: vkpDja /// + /// vkpDja [global::System.Text.Json.Serialization.JsonPropertyName("redacted_api_key")] [global::System.Text.Json.Serialization.JsonRequired] public required string RedactedApiKey1 { get; set; } @@ -27,6 +28,7 @@ public sealed partial class RedactedApiKey /// A URL safe base64 encoded UUID
/// Example: JRPVD7jWR1aTBYiJ0UFVOg== /// + /// JRPVD7jWR1aTBYiJ0UFVOg== [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string ApiKeyId { get; set; } @@ -37,91 +39,36 @@ public sealed partial class RedactedApiKey [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::Ideogram.RedactedApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RedactedApiKey), - jsonSerializerContext) as global::Ideogram.RedactedApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RedactedApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A redacted text snippet of the API key. Contains the first 4 characters of the API key
+ /// Example: vkpDja + /// + /// + /// The time at which the key was created + /// + /// + /// A URL safe base64 encoded UUID
+ /// Example: JRPVD7jWR1aTBYiJ0UFVOg== + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RedactedApiKey( + string redactedApiKey1, + global::System.DateTime creationTime, + string apiKeyId) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RedactedApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RedactedApiKey; + this.RedactedApiKey1 = redactedApiKey1 ?? throw new global::System.ArgumentNullException(nameof(redactedApiKey1)); + this.CreationTime = creationTime; + this.ApiKeyId = apiKeyId ?? throw new global::System.ArgumentNullException(nameof(apiKeyId)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public RedactedApiKey() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.Json.g.cs new file mode 100644 index 0000000..4480ff7 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class RemixImageRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.RemixImageRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.RemixImageRequest), + jsonSerializerContext) as global::Ideogram.RemixImageRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.RemixImageRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.RemixImageRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemixImageRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.g.cs index 961438c..063849d 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequest.g.cs @@ -35,91 +35,34 @@ public sealed partial class RemixImageRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.RemixImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.RemixImageRequest), - jsonSerializerContext) as global::Ideogram.RemixImageRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.RemixImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A request to generate a new image using a provided image and a prompt. + /// + /// + /// An image binary; only JPEG, WEBPs and PNGs are supported at this time + /// + /// + /// An image binary; only JPEG, WEBPs and PNGs are supported at this time + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RemixImageRequest( + global::Ideogram.InitialImageRequest imageRequest, + byte[] imageFile, + string imageFilename) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.RemixImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.RemixImageRequest; + this.ImageRequest = imageRequest ?? throw new global::System.ArgumentNullException(nameof(imageRequest)); + this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); + this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public RemixImageRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.Json.g.cs new file mode 100644 index 0000000..23560d2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class UpscaleImageRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.UpscaleImageRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.UpscaleImageRequest), + jsonSerializerContext) as global::Ideogram.UpscaleImageRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.UpscaleImageRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.UpscaleImageRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleImageRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.g.cs index 9f25ac5..a2798b4 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleImageRequest.g.cs @@ -35,91 +35,34 @@ public sealed partial class UpscaleImageRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleImageRequest), - jsonSerializerContext) as global::Ideogram.UpscaleImageRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A request to upscale a provided image with the help of an optional prompt. + /// + /// + /// An image binary; only JPEG, WEBPs and PNGs are supported at this time + /// + /// + /// An image binary; only JPEG, WEBPs and PNGs are supported at this time + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public UpscaleImageRequest( + global::Ideogram.UpscaleInitialImageRequest imageRequest, + byte[] imageFile, + string imageFilename) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleImageRequest; + this.ImageRequest = imageRequest ?? throw new global::System.ArgumentNullException(nameof(imageRequest)); + this.ImageFile = imageFile ?? throw new global::System.ArgumentNullException(nameof(imageFile)); + this.ImageFilename = imageFilename ?? throw new global::System.ArgumentNullException(nameof(imageFilename)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public UpscaleImageRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.Json.g.cs new file mode 100644 index 0000000..821eadd --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class UpscaleInitialImageRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Ideogram.UpscaleInitialImageRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.UpscaleInitialImageRequest), + jsonSerializerContext) as global::Ideogram.UpscaleInitialImageRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Ideogram.UpscaleInitialImageRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Ideogram.UpscaleInitialImageRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleInitialImageRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.g.cs index 13dd666..094ff08 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Models.UpscaleInitialImageRequest.g.cs @@ -12,6 +12,7 @@ public sealed partial class UpscaleInitialImageRequest /// An optional prompt to guide the upscale
/// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. /// + /// A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] public string? Prompt { get; set; } @@ -19,6 +20,7 @@ public sealed partial class UpscaleInitialImageRequest /// Default Value: 50
/// Example: 50 /// + /// 50 [global::System.Text.Json.Serialization.JsonPropertyName("resemblance")] public int? Resemblance { get; set; } @@ -26,6 +28,7 @@ public sealed partial class UpscaleInitialImageRequest /// Default Value: 50
/// Example: 50 /// + /// 50 [global::System.Text.Json.Serialization.JsonPropertyName("detail")] public int? Detail { get; set; } @@ -34,6 +37,7 @@ public sealed partial class UpscaleInitialImageRequest /// Default Value: AUTO
/// Example: ON /// + /// ON [global::System.Text.Json.Serialization.JsonPropertyName("magic_prompt_option")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.MagicPromptOptionJsonConverter))] public global::Ideogram.MagicPromptOption? MagicPromptOption { get; set; } @@ -41,6 +45,7 @@ public sealed partial class UpscaleInitialImageRequest /// /// Example: 12345 /// + /// 12345 [global::System.Text.Json.Serialization.JsonPropertyName("seed")] public int? Seed { get; set; } @@ -50,91 +55,49 @@ public sealed partial class UpscaleInitialImageRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Ideogram.UpscaleInitialImageRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Ideogram.UpscaleInitialImageRequest), - jsonSerializerContext) as global::Ideogram.UpscaleInitialImageRequest; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Ideogram.UpscaleInitialImageRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// An optional prompt to guide the upscale
+ /// Example: A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset. + /// + /// + /// Default Value: 50
+ /// Example: 50 + /// + /// + /// Default Value: 50
+ /// Example: 50 + /// + /// + /// Determine if MagicPrompt should be used in generating the request or not
+ /// Default Value: AUTO
+ /// Example: ON + /// + /// + /// Example: 12345 + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public UpscaleInitialImageRequest( + string? prompt, + int? resemblance, + int? detail, + global::Ideogram.MagicPromptOption? magicPromptOption, + int? seed) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Ideogram.UpscaleInitialImageRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.UpscaleInitialImageRequest; + this.Prompt = prompt; + this.Resemblance = resemblance; + this.Detail = detail; + this.MagicPromptOption = magicPromptOption; + this.Seed = seed; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public UpscaleInitialImageRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.PathBuilder.g.cs b/src/libs/Ideogram/Generated/Ideogram.PathBuilder.g.cs index 72de2e4..f61a7fa 100644 --- a/src/libs/Ideogram/Generated/Ideogram.PathBuilder.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.PathBuilder.g.cs @@ -1,5 +1,3 @@ -using System.Linq; - #nullable enable namespace Ideogram @@ -103,7 +101,11 @@ public PathBuilder AddRequiredParameter( string delimiter = ",", bool explode = false) { - AddRequiredParameter(name, value.Select(selector).ToArray(), delimiter, explode); + AddRequiredParameter( + name, + global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(value, selector)), + delimiter, + explode); return this; } @@ -167,7 +169,11 @@ public PathBuilder AddOptionalParameter( { if (value is not null) { - AddRequiredParameter(name, value.Select(selector).ToArray(), delimiter, explode); + AddRequiredParameter( + name, + global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(value, selector)), + delimiter, + explode); } return this; diff --git a/src/libs/Ideogram/Generated/Ideogram.Polyfills.g.cs b/src/libs/Ideogram/Generated/Ideogram.Polyfills.g.cs index 58098b4..ac222d4 100644 --- a/src/libs/Ideogram/Generated/Ideogram.Polyfills.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.Polyfills.g.cs @@ -7,7 +7,7 @@ namespace Ideogram /// /// /// - public static partial class AutoSDKPolyfills + public static partial class AutoSdkPolyfills { /// /// diff --git a/src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribe.g.cs b/src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribe.g.cs index 0797754..47ee1d6 100644 --- a/src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribe.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.VisionClient.PostDescribe.g.cs @@ -28,7 +28,7 @@ partial void ProcessPostDescribeResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task PostDescribeAsync( global::Ideogram.DescribeRequest request, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,30 +90,147 @@ partial void ProcessPostDescribeResponseContent( ProcessPostDescribeResponse( httpClient: HttpClient, httpResponseMessage: __response); + // + if ((int)__response.StatusCode == 400) + { + 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); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPostDescribeResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Image failed the safety check. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::Ideogram.ImageSafetyError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::Ideogram.ImageSafetyError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::Ideogram.ImageSafetyError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - try + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 429) { - __response.EnsureSuccessStatusCode(); + string? __content_429 = null; + if (ReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + var __contentStream_429 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + } + + throw new global::Ideogram.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; } - catch (global::System.Net.Http.HttpRequestException __ex) + + if (ReadResponseAsString) { - throw new global::System.InvalidOperationException(__content, __ex); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPostDescribeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __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), + }; + } + + return + global::Ideogram.DescribeResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } + 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 __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - return - global::Ideogram.DescribeResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + var __responseValue = await global::Ideogram.DescribeResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/Ideogram/Generated/Ideogram.VisionClient.g.cs b/src/libs/Ideogram/Generated/Ideogram.VisionClient.g.cs index 90a2ade..9bfb1ba 100644 --- a/src/libs/Ideogram/Generated/Ideogram.VisionClient.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.VisionClient.g.cs @@ -26,6 +26,11 @@ public sealed partial class VisionClient : global::Ideogram.IVisionClient, globa /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// ///