diff --git a/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeTextV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeTextV3.g.cs new file mode 100644 index 0000000..0e499a9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostLayerizeTextV3.g.cs @@ -0,0 +1,345 @@ + +#nullable enable + +namespace Ideogram +{ + public partial class GenerateClient + { + partial void PreparePostLayerizeTextV3Arguments( + global::System.Net.Http.HttpClient httpClient, + global::Ideogram.LayerizeTextRequest request); + partial void PreparePostLayerizeTextV3Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Ideogram.LayerizeTextRequest request); + partial void ProcessPostLayerizeTextV3Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessPostLayerizeTextV3ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Detect and extract text layers from an image
+ /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
+ /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
+ /// Supported image formats include JPEG, PNG, and WebP (max size 10MB).
+ /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. + ///
+ /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task PostLayerizeTextV3Async( + + global::Ideogram.LayerizeTextRequest request, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PreparePostLayerizeTextV3Arguments( + httpClient: HttpClient, + request: request); + + var __pathBuilder = new global::Ideogram.PathBuilder( + path: "/v1/ideogram-v3/layerize-text", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in Authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"{request.Prompt}"), + name: "\"prompt\""); + } + if (request.Seed != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent($"{request.Seed}"), + name: "\"seed\""); + } + __httpRequest.Content = __httpRequestContent; + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PreparePostLayerizeTextV3Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + using var __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessPostLayerizeTextV3Response( + httpClient: HttpClient, + httpResponseMessage: __response); + // + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + try + { + if (ReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::Ideogram.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + 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; + global::System.Exception? __exception_401 = null; + try + { + if (ReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Ideogram.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + try + { + if (ReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + throw new global::Ideogram.ApiException( + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + statusCode: __response.StatusCode) + { + ResponseBody = __content_429, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessPostLayerizeTextV3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Ideogram.LayerizeTextResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Ideogram.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Ideogram.LayerizeTextResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + 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), + }; + } + } + } + /// + /// Detect and extract text layers from an image
+ /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
+ /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
+ /// Supported image formats include JPEG, PNG, and WebP (max size 10MB).
+ /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. + ///
+ /// + /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 10MB). + /// + /// + /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 10MB). + /// + /// + /// An optional text description of the image. If not provided, a description will be auto-generated from the image. + /// + /// + /// Random seed. Set for reproducible generation.
+ /// Example: 12345 + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task PostLayerizeTextV3Async( + byte[] image, + string imagename, + string? prompt = default, + int? seed = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Ideogram.LayerizeTextRequest + { + Image = image, + Imagename = imagename, + Prompt = prompt, + Seed = seed, + }; + + return await PostLayerizeTextV3Async( + request: __request, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeTextV3.g.cs b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeTextV3.g.cs new file mode 100644 index 0000000..2b5e83a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostLayerizeTextV3.g.cs @@ -0,0 +1,50 @@ +#nullable enable + +namespace Ideogram +{ + public partial interface IGenerateClient + { + /// + /// Detect and extract text layers from an image
+ /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
+ /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
+ /// Supported image formats include JPEG, PNG, and WebP (max size 10MB).
+ /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. + ///
+ /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task PostLayerizeTextV3Async( + + global::Ideogram.LayerizeTextRequest request, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detect and extract text layers from an image
+ /// Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.
+ /// The response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.
+ /// Supported image formats include JPEG, PNG, and WebP (max size 10MB).
+ /// Image links are available for a limited period of time; if you would like to keep the image, you must download it. + ///
+ /// + /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 10MB). + /// + /// + /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 10MB). + /// + /// + /// An optional text description of the image. If not provided, a description will be auto-generated from the image. + /// + /// + /// Random seed. Set for reproducible generation.
+ /// Example: 12345 + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task PostLayerizeTextV3Async( + byte[] image, + string imagename, + string? prompt = default, + int? seed = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockAlignment.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockAlignment.g.cs new file mode 100644 index 0000000..224df0f --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockAlignment.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class DetectedTextBlockAlignmentJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.DetectedTextBlockAlignment Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.DetectedTextBlockAlignmentExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.DetectedTextBlockAlignment)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.DetectedTextBlockAlignment); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.DetectedTextBlockAlignment value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.DetectedTextBlockAlignmentExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockAlignmentNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockAlignmentNullable.g.cs new file mode 100644 index 0000000..577aee9 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockAlignmentNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class DetectedTextBlockAlignmentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.DetectedTextBlockAlignment? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.DetectedTextBlockAlignmentExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.DetectedTextBlockAlignment)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.DetectedTextBlockAlignment?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.DetectedTextBlockAlignment? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.DetectedTextBlockAlignmentExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItem.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItem.g.cs new file mode 100644 index 0000000..e6d9da2 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItem.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class DetectedTextBlockFormattingItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.DetectedTextBlockFormattingItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.DetectedTextBlockFormattingItemExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.DetectedTextBlockFormattingItem)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.DetectedTextBlockFormattingItem); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.DetectedTextBlockFormattingItem value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.DetectedTextBlockFormattingItemExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullable.g.cs new file mode 100644 index 0000000..0dcfca5 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class DetectedTextBlockFormattingItemNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.DetectedTextBlockFormattingItem? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.DetectedTextBlockFormattingItemExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.DetectedTextBlockFormattingItem)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.DetectedTextBlockFormattingItem?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.DetectedTextBlockFormattingItem? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.DetectedTextBlockFormattingItemExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockRole.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockRole.g.cs new file mode 100644 index 0000000..8c2ca6e --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockRole.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class DetectedTextBlockRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.DetectedTextBlockRole Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.DetectedTextBlockRoleExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.DetectedTextBlockRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.DetectedTextBlockRole); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.DetectedTextBlockRole value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Ideogram.DetectedTextBlockRoleExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockRoleNullable.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockRoleNullable.g.cs new file mode 100644 index 0000000..ff3cf2a --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.JsonConverters.DetectedTextBlockRoleNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Ideogram.JsonConverters +{ + /// + public sealed class DetectedTextBlockRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Ideogram.DetectedTextBlockRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Ideogram.DetectedTextBlockRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Ideogram.DetectedTextBlockRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Ideogram.DetectedTextBlockRole?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Ideogram.DetectedTextBlockRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Ideogram.DetectedTextBlockRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs index 0e86a83..2cf6633 100644 --- a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContext.g.cs @@ -41,6 +41,18 @@ namespace Ideogram typeof(global::Ideogram.JsonConverters.TextItemV3GlyphTypeNullableJsonConverter), + typeof(global::Ideogram.JsonConverters.DetectedTextBlockAlignmentJsonConverter), + + typeof(global::Ideogram.JsonConverters.DetectedTextBlockAlignmentNullableJsonConverter), + + typeof(global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemJsonConverter), + + typeof(global::Ideogram.JsonConverters.DetectedTextBlockFormattingItemNullableJsonConverter), + + typeof(global::Ideogram.JsonConverters.DetectedTextBlockRoleJsonConverter), + + typeof(global::Ideogram.JsonConverters.DetectedTextBlockRoleNullableJsonConverter), + typeof(global::Ideogram.JsonConverters.ToolTypeJsonConverter), typeof(global::Ideogram.JsonConverters.ToolTypeNullableJsonConverter), @@ -244,6 +256,14 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.TextItemV3GlyphType), TypeInfoPropertyName = "TextItemV3GlyphType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeTextRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.LayerizeTextResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlock))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockAlignment), TypeInfoPropertyName = "DetectedTextBlockAlignment2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockFormattingItem), TypeInfoPropertyName = "DetectedTextBlockFormattingItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.DetectedTextBlockRole), TypeInfoPropertyName = "DetectedTextBlockRole2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalBatchResultsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.InternalBatchResultsResponseResultsInner))] @@ -366,6 +386,8 @@ namespace Ideogram [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] diff --git a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs index af3e91c..b12ddd0 100644 --- a/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs +++ b/src/libs/Ideogram/Generated/Ideogram.JsonSerializerContextTypes.g.cs @@ -356,439 +356,471 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Ideogram.InternalBatchResultsResponse? Type82 { get; set; } + public global::Ideogram.LayerizeTextRequest? Type82 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type83 { get; set; } + public global::Ideogram.LayerizeTextResponse? Type83 { get; set; } /// /// /// - public global::Ideogram.InternalBatchResultsResponseResultsInner? Type84 { get; set; } + public global::System.Collections.Generic.IList? Type84 { get; set; } /// /// /// - public global::Ideogram.ImageSafetyError? Type85 { get; set; } + public global::Ideogram.DetectedTextBlock? Type85 { get; set; } /// /// /// - public global::Ideogram.ManageApiSubscriptionResponse? Type86 { get; set; } + public global::Ideogram.DetectedTextBlockAlignment? Type86 { get; set; } /// /// /// - public global::Ideogram.MetronomeLinks? Type87 { get; set; } + public global::System.Collections.Generic.IList? Type87 { get; set; } /// /// /// - public global::Ideogram.RechargeSettingsResponse? Type88 { get; set; } + public global::Ideogram.DetectedTextBlockFormattingItem? Type88 { get; set; } /// /// /// - public global::Ideogram.Price? Type89 { get; set; } + public global::Ideogram.DetectedTextBlockRole? Type89 { get; set; } /// /// /// - public global::Ideogram.RechargeSettings? Type90 { get; set; } + public global::Ideogram.InternalBatchResultsResponse? Type90 { get; set; } /// /// /// - public global::Ideogram.PostApiSubscriptionResponse? Type91 { get; set; } + public global::System.Collections.Generic.IList? Type91 { get; set; } /// /// /// - public global::Ideogram.PostApiSubscriptionError? Type92 { get; set; } + public global::Ideogram.InternalBatchResultsResponseResultsInner? Type92 { get; set; } /// /// /// - public global::Ideogram.PostApiSubscriptionRequest? Type93 { get; set; } + public global::Ideogram.ImageSafetyError? Type93 { get; set; } /// /// /// - public global::Ideogram.PostApiReactivateResponse? Type94 { get; set; } + public global::Ideogram.ManageApiSubscriptionResponse? Type94 { get; set; } /// /// /// - public global::Ideogram.GetApiKeysResponse? Type95 { get; set; } + public global::Ideogram.MetronomeLinks? Type95 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type96 { get; set; } + public global::Ideogram.RechargeSettingsResponse? Type96 { get; set; } /// /// /// - public global::Ideogram.RedactedApiKey? Type97 { get; set; } + public global::Ideogram.Price? Type97 { get; set; } /// /// /// - public global::Ideogram.PostApiKeyResponse? Type98 { get; set; } + public global::Ideogram.RechargeSettings? Type98 { get; set; } /// /// /// - public global::Ideogram.ManageApiStripeSubscriptionResponse? Type99 { get; set; } + public global::Ideogram.PostApiSubscriptionResponse? Type99 { get; set; } /// /// /// - public global::Ideogram.GetApiTermsResponse? Type100 { get; set; } + public global::Ideogram.PostApiSubscriptionError? Type100 { get; set; } /// /// /// - public global::Ideogram.ApiTerms? Type101 { get; set; } + public global::Ideogram.PostApiSubscriptionRequest? Type101 { get; set; } /// /// /// - public global::Ideogram.PostApiTermsRequest? Type102 { get; set; } + public global::Ideogram.PostApiReactivateResponse? Type102 { get; set; } /// /// /// - public global::Ideogram.PostAddCreditsResponse? Type103 { get; set; } + public global::Ideogram.GetApiKeysResponse? Type103 { get; set; } /// /// /// - public global::Ideogram.PostAddCreditsError? Type104 { get; set; } + public global::System.Collections.Generic.IList? Type104 { get; set; } /// /// /// - public global::Ideogram.PostAddCreditsRequest? Type105 { get; set; } + public global::Ideogram.RedactedApiKey? Type105 { get; set; } /// /// /// - public global::Ideogram.GetUserCreditsResponse? Type106 { get; set; } + public global::Ideogram.PostApiKeyResponse? Type106 { get; set; } /// /// /// - public global::Ideogram.SpendCommitInfoResponse? Type107 { get; set; } + public global::Ideogram.ManageApiStripeSubscriptionResponse? Type107 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type108 { get; set; } + public global::Ideogram.GetApiTermsResponse? Type108 { get; set; } /// /// /// - public global::Ideogram.SpendCommitInfo? Type109 { get; set; } + public global::Ideogram.ApiTerms? Type109 { get; set; } /// /// /// - public global::Ideogram.GetUsageInfoResponse? Type110 { get; set; } + public global::Ideogram.PostApiTermsRequest? Type110 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type111 { get; set; } + public global::Ideogram.PostAddCreditsResponse? Type111 { get; set; } /// /// /// - public global::Ideogram.UsageSegment? Type112 { get; set; } + public global::Ideogram.PostAddCreditsError? Type112 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type113 { get; set; } + public global::Ideogram.PostAddCreditsRequest? Type113 { get; set; } /// /// /// - public global::Ideogram.ToolUsage? Type114 { get; set; } + public global::Ideogram.GetUserCreditsResponse? Type114 { get; set; } /// /// /// - public global::Ideogram.ToolType? Type115 { get; set; } + public global::Ideogram.SpendCommitInfoResponse? Type115 { get; set; } /// /// /// - public global::Ideogram.ModelVersion? Type116 { get; set; } + public global::System.Collections.Generic.IList? Type116 { get; set; } /// /// /// - public global::Ideogram.SegmentBy? Type117 { get; set; } + public global::Ideogram.SpendCommitInfo? Type117 { get; set; } /// /// /// - public global::Ideogram.UsageSource? Type118 { get; set; } + public global::Ideogram.GetUsageInfoResponse? Type118 { get; set; } /// /// /// - public global::Ideogram.GetApiProfilesResponse? Type119 { get; set; } + public global::System.Collections.Generic.IList? Type119 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type120 { get; set; } + public global::Ideogram.UsageSegment? Type120 { get; set; } /// /// /// - public global::Ideogram.ApiProfile? Type121 { get; set; } + public global::System.Collections.Generic.IList? Type121 { get; set; } /// /// /// - public global::Ideogram.ApiProfileType? Type122 { get; set; } + public global::Ideogram.ToolUsage? Type122 { get; set; } /// /// /// - public global::Ideogram.ApiProfileRole? Type123 { get; set; } + public global::Ideogram.ToolType? Type123 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type124 { get; set; } + public global::Ideogram.ModelVersion? Type124 { get; set; } /// /// /// - public global::Ideogram.ApiProfileApiKey? Type125 { get; set; } + public global::Ideogram.SegmentBy? Type125 { get; set; } /// /// /// - public global::Ideogram.ApiKeyStatus? Type126 { get; set; } + public global::Ideogram.UsageSource? Type126 { get; set; } /// /// /// - public global::Ideogram.GetApiOrganizationUserSuggestionsResponse? Type127 { get; set; } + public global::Ideogram.GetApiProfilesResponse? Type127 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type128 { get; set; } + public global::System.Collections.Generic.IList? Type128 { get; set; } /// /// /// - public global::Ideogram.ApiOrganizationUserSuggestion? Type129 { get; set; } + public global::Ideogram.ApiProfile? Type129 { get; set; } /// /// /// - public global::Ideogram.GetOrganizationMembersResponse? Type130 { get; set; } + public global::Ideogram.ApiProfileType? Type130 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type131 { get; set; } + public global::Ideogram.ApiProfileRole? Type131 { get; set; } /// /// /// - public global::Ideogram.OrganizationMember? Type132 { get; set; } + public global::System.Collections.Generic.IList? Type132 { get; set; } /// /// /// - public global::Ideogram.CreateApiKeyResponse? Type133 { get; set; } + public global::Ideogram.ApiProfileApiKey? Type133 { get; set; } /// /// /// - public global::Ideogram.GetApiKeysV2Response? Type134 { get; set; } + public global::Ideogram.ApiKeyStatus? Type134 { get; set; } /// /// /// - public global::Ideogram.OrganizationMemberOperationResponse? Type135 { get; set; } + public global::Ideogram.GetApiOrganizationUserSuggestionsResponse? Type135 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type136 { get; set; } + public global::System.Collections.Generic.IList? Type136 { get; set; } /// /// /// - public global::Ideogram.OrganizationMemberOperationResult? Type137 { get; set; } + public global::Ideogram.ApiOrganizationUserSuggestion? Type137 { get; set; } /// /// /// - public global::Ideogram.AddOrganizationMembersRequest? Type138 { get; set; } + public global::Ideogram.GetOrganizationMembersResponse? Type138 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type139 { get; set; } + public global::System.Collections.Generic.IList? Type139 { get; set; } /// /// /// - public global::Ideogram.LiteOrganizationMember? Type140 { get; set; } + public global::Ideogram.OrganizationMember? Type140 { get; set; } /// /// /// - public global::Ideogram.RemoveOrganizationMembersRequest? Type141 { get; set; } + public global::Ideogram.CreateApiKeyResponse? Type141 { get; set; } /// /// /// - public global::Ideogram.PromoteOrganizationMembersRequest? Type142 { get; set; } + public global::Ideogram.GetApiKeysV2Response? Type142 { get; set; } /// /// /// - public global::Ideogram.ListOrganizationInvoicesResponse? Type143 { get; set; } + public global::Ideogram.OrganizationMemberOperationResponse? Type143 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type144 { get; set; } + public global::System.Collections.Generic.IList? Type144 { get; set; } /// /// /// - public global::Ideogram.Invoice? Type145 { get; set; } + public global::Ideogram.OrganizationMemberOperationResult? Type145 { get; set; } /// /// /// - public global::Ideogram.InvoiceStatus? Type146 { get; set; } + public global::Ideogram.AddOrganizationMembersRequest? Type146 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type147 { get; set; } + public global::System.Collections.Generic.IList? Type147 { get; set; } /// /// /// - public global::Ideogram.InvoiceLineItem? Type148 { get; set; } + public global::Ideogram.LiteOrganizationMember? Type148 { get; set; } /// /// /// - public global::Ideogram.ListDatasetsResponse? Type149 { get; set; } + public global::Ideogram.RemoveOrganizationMembersRequest? Type149 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type150 { get; set; } + public global::Ideogram.PromoteOrganizationMembersRequest? Type150 { get; set; } /// /// /// - public global::Ideogram.Dataset? Type151 { get; set; } + public global::Ideogram.ListOrganizationInvoicesResponse? Type151 { get; set; } /// /// /// - public global::Ideogram.AssetIdentifier? Type152 { get; set; } + public global::System.Collections.Generic.IList? Type152 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type153 { get; set; } + public global::Ideogram.Invoice? Type153 { get; set; } /// /// /// - public global::Ideogram.SharingInfo? Type154 { get; set; } + public global::Ideogram.InvoiceStatus? Type154 { get; set; } /// /// /// - public global::Ideogram.CreateDatasetRequest? Type155 { get; set; } + public global::System.Collections.Generic.IList? Type155 { get; set; } /// /// /// - public global::Ideogram.UploadDatasetAssetsResponse? Type156 { get; set; } + public global::Ideogram.InvoiceLineItem? Type156 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type157 { get; set; } + public global::Ideogram.ListDatasetsResponse? Type157 { get; set; } /// /// /// - public global::Ideogram.DatasetUploadSucceededAsset? Type158 { get; set; } + public global::System.Collections.Generic.IList? Type158 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type159 { get; set; } + public global::Ideogram.Dataset? Type159 { get; set; } /// /// /// - public global::Ideogram.DatasetUploadFailedAsset? Type160 { get; set; } + public global::Ideogram.AssetIdentifier? Type160 { get; set; } /// /// /// - public global::Ideogram.DatasetAssetFailureReason? Type161 { get; set; } + public global::System.Collections.Generic.IList? Type161 { get; set; } /// /// /// - public global::Ideogram.UploadDatasetAssetsRequest? Type162 { get; set; } + public global::Ideogram.SharingInfo? Type162 { get; set; } /// /// /// - public global::Ideogram.TrainDatasetModelResponse? Type163 { get; set; } + public global::Ideogram.CreateDatasetRequest? Type163 { get; set; } /// /// /// - public global::Ideogram.TrainDatasetModelRequest? Type164 { get; set; } + public global::Ideogram.UploadDatasetAssetsResponse? Type164 { get; set; } /// /// /// - public double? Type165 { get; set; } + public global::System.Collections.Generic.IList? Type165 { get; set; } /// /// /// - public global::Ideogram.ListModelsResponse? Type166 { get; set; } + public global::Ideogram.DatasetUploadSucceededAsset? Type166 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type167 { get; set; } + public global::System.Collections.Generic.IList? Type167 { get; set; } /// /// /// - public global::Ideogram.CustomModel? Type168 { get; set; } + public global::Ideogram.DatasetUploadFailedAsset? Type168 { get; set; } /// /// /// - public global::Ideogram.ModelStatus? Type169 { get; set; } + public global::Ideogram.DatasetAssetFailureReason? Type169 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type170 { get; set; } + public global::Ideogram.UploadDatasetAssetsRequest? Type170 { get; set; } /// /// /// - public global::Ideogram.TrainingRun? Type171 { get; set; } + public global::Ideogram.TrainDatasetModelResponse? Type171 { get; set; } /// /// /// - public global::Ideogram.TrainingRunStatus? Type172 { get; set; } + public global::Ideogram.TrainDatasetModelRequest? Type172 { get; set; } /// /// /// - public global::Ideogram.GetModelResponse? Type173 { get; set; } + public double? Type173 { get; set; } /// /// /// - public global::Ideogram.ColorPaletteWithPresetName? Type174 { get; set; } + public global::Ideogram.ListModelsResponse? Type174 { get; set; } /// /// /// - public global::Ideogram.ColorPaletteWithMembers? Type175 { get; set; } + public global::System.Collections.Generic.IList? Type175 { get; set; } /// /// /// - public global::Ideogram.ColorPalettePresetName? Type176 { get; set; } + public global::Ideogram.CustomModel? Type176 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type177 { get; set; } + public global::Ideogram.ModelStatus? Type177 { get; set; } /// /// /// - public global::Ideogram.ColorPaletteMember? Type178 { get; set; } + public global::System.Collections.Generic.IList? Type178 { get; set; } /// /// /// - public global::Ideogram.AssetType? Type179 { get; set; } + public global::Ideogram.TrainingRun? Type179 { get; set; } /// /// /// - public global::Ideogram.SharingPermission? Type180 { get; set; } + public global::Ideogram.TrainingRunStatus? Type180 { get; set; } /// /// /// - public global::Ideogram.OrganizationObject? Type181 { get; set; } + public global::Ideogram.GetModelResponse? Type181 { get; set; } /// /// /// - public global::Ideogram.User? Type182 { get; set; } + public global::Ideogram.ColorPaletteWithPresetName? Type182 { get; set; } /// /// /// - public global::Ideogram.OrganizationType? Type183 { get; set; } + public global::Ideogram.ColorPaletteWithMembers? Type183 { get; set; } /// /// /// - public global::Ideogram.OrganizationRoleEnum? Type184 { get; set; } + public global::Ideogram.ColorPalettePresetName? Type184 { get; set; } /// /// /// - public global::Ideogram.OrganizationAvatarObject? Type185 { get; set; } + public global::System.Collections.Generic.IList? Type185 { get; set; } /// /// /// - public global::Ideogram.PostInternalTesting200Response? Type186 { get; set; } + public global::Ideogram.ColorPaletteMember? Type186 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type187 { get; set; } + public global::Ideogram.AssetType? Type187 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type188 { get; set; } + public global::Ideogram.SharingPermission? Type188 { get; set; } /// /// /// - public global::Ideogram.ListCustomModelsScope? Type189 { get; set; } + public global::Ideogram.OrganizationObject? Type189 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type190 { get; set; } + public global::Ideogram.User? Type190 { get; set; } + /// + /// + /// + public global::Ideogram.OrganizationType? Type191 { get; set; } + /// + /// + /// + public global::Ideogram.OrganizationRoleEnum? Type192 { get; set; } + /// + /// + /// + public global::Ideogram.OrganizationAvatarObject? Type193 { get; set; } + /// + /// + /// + public global::Ideogram.PostInternalTesting200Response? Type194 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type195 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type196 { get; set; } + /// + /// + /// + public global::Ideogram.ListCustomModelsScope? Type197 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type198 { get; set; } /// /// @@ -845,94 +877,102 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType13 { get; set; } + public global::System.Collections.Generic.List? ListType13 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType14 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType15 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType14 { get; set; } + public global::System.Collections.Generic.List? ListType16 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType15 { get; set; } + public global::System.Collections.Generic.List? ListType17 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType16 { get; set; } + public global::System.Collections.Generic.List? ListType18 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType17 { get; set; } + public global::System.Collections.Generic.List? ListType19 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType18 { get; set; } + public global::System.Collections.Generic.List? ListType20 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType19 { get; set; } + public global::System.Collections.Generic.List? ListType21 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType20 { get; set; } + public global::System.Collections.Generic.List? ListType22 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType21 { get; set; } + public global::System.Collections.Generic.List? ListType23 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType22 { get; set; } + public global::System.Collections.Generic.List? ListType24 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType23 { get; set; } + public global::System.Collections.Generic.List? ListType25 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType24 { get; set; } + public global::System.Collections.Generic.List? ListType26 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType25 { get; set; } + public global::System.Collections.Generic.List? ListType27 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType26 { get; set; } + public global::System.Collections.Generic.List? ListType28 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType27 { get; set; } + public global::System.Collections.Generic.List? ListType29 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType28 { get; set; } + public global::System.Collections.Generic.List? ListType30 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType29 { get; set; } + public global::System.Collections.Generic.List? ListType31 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType30 { get; set; } + public global::System.Collections.Generic.List? ListType32 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType31 { get; set; } + public global::System.Collections.Generic.List? ListType33 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType32 { get; set; } + public global::System.Collections.Generic.List? ListType34 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType33 { get; set; } + public global::System.Collections.Generic.List? ListType35 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType34 { get; set; } + public global::System.Collections.Generic.List? ListType36 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType35 { get; set; } + public global::System.Collections.Generic.List? ListType37 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlock.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlock.Json.g.cs new file mode 100644 index 0000000..aed358d --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlock.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class DetectedTextBlock + { + /// + /// 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.DetectedTextBlock? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.DetectedTextBlock), + jsonSerializerContext) as global::Ideogram.DetectedTextBlock; + } + + /// + /// 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.DetectedTextBlock? 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.DetectedTextBlock), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.DetectedTextBlock; + } + + /// + /// 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.DetectedTextBlock.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlock.g.cs new file mode 100644 index 0000000..3ba07b8 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlock.g.cs @@ -0,0 +1,206 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// A single detected text region with its position, content, font information, and styling.
+ /// Example: {"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5} + ///
+ public sealed partial class DetectedTextBlock + { + /// + /// X coordinate in pixels from the top-left corner. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("x")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int X { get; set; } + + /// + /// Y coordinate in pixels from the top-left corner. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("y")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Y { get; set; } + + /// + /// Width of the text region in pixels. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("width")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Width { get; set; } + + /// + /// Height of the text region in pixels. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("height")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Height { get; set; } + + /// + /// The detected text content. Line breaks are represented as \n.
+ /// Example: Hello World + ///
+ /// Hello World + [global::System.Text.Json.Serialization.JsonPropertyName("text")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Text { get; set; } + + /// + /// Detected text alignment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("alignment")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.DetectedTextBlockAlignmentJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Ideogram.DetectedTextBlockAlignment Alignment { get; set; } + + /// + /// Rotation angle in degrees (clockwise). Defaults to 0.
+ /// Default Value: 0 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("angle")] + public float? Angle { get; set; } + + /// + /// Best-matching font name from the font library. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("font_name")] + public string? FontName { get; set; } + + /// + /// Alternative font matches, ranked by similarity. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("font_alternatives")] + public global::System.Collections.Generic.IList? FontAlternatives { get; set; } + + /// + /// Detected font size in points. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("font_size")] + public int? FontSize { get; set; } + + /// + /// Line height multiplier (e.g., 1.2). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("line_height")] + public float? LineHeight { get; set; } + + /// + /// Detected text color in hex format.
+ /// Example: #212121 + ///
+ /// #212121 + [global::System.Text.Json.Serialization.JsonPropertyName("color")] + public string? Color { get; set; } + + /// + /// Detected text formatting effects. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("formatting")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Formatting { get; set; } + + /// + /// Inferred typographic role of this text block. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("role")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.DetectedTextBlockRoleJsonConverter))] + public global::Ideogram.DetectedTextBlockRole? Role { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// X coordinate in pixels from the top-left corner. + /// + /// + /// Y coordinate in pixels from the top-left corner. + /// + /// + /// Width of the text region in pixels. + /// + /// + /// Height of the text region in pixels. + /// + /// + /// The detected text content. Line breaks are represented as \n.
+ /// Example: Hello World + /// + /// + /// Detected text alignment. + /// + /// + /// Detected text formatting effects. + /// + /// + /// Rotation angle in degrees (clockwise). Defaults to 0.
+ /// Default Value: 0 + /// + /// + /// Best-matching font name from the font library. + /// + /// + /// Alternative font matches, ranked by similarity. + /// + /// + /// Detected font size in points. + /// + /// + /// Line height multiplier (e.g., 1.2). + /// + /// + /// Detected text color in hex format.
+ /// Example: #212121 + /// + /// + /// Inferred typographic role of this text block. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DetectedTextBlock( + int x, + int y, + int width, + int height, + string text, + global::Ideogram.DetectedTextBlockAlignment alignment, + global::System.Collections.Generic.IList formatting, + float? angle, + string? fontName, + global::System.Collections.Generic.IList? fontAlternatives, + int? fontSize, + float? lineHeight, + string? color, + global::Ideogram.DetectedTextBlockRole? role) + { + this.X = x; + this.Y = y; + this.Width = width; + this.Height = height; + this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); + this.Alignment = alignment; + this.Angle = angle; + this.FontName = fontName; + this.FontAlternatives = fontAlternatives; + this.FontSize = fontSize; + this.LineHeight = lineHeight; + this.Color = color; + this.Formatting = formatting ?? throw new global::System.ArgumentNullException(nameof(formatting)); + this.Role = role; + } + + /// + /// Initializes a new instance of the class. + /// + public DetectedTextBlock() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockAlignment.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockAlignment.g.cs new file mode 100644 index 0000000..3200549 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockAlignment.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Detected text alignment. + /// + public enum DetectedTextBlockAlignment + { + /// + /// + /// + Center, + /// + /// + /// + Left, + /// + /// + /// + Right, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DetectedTextBlockAlignmentExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DetectedTextBlockAlignment value) + { + return value switch + { + DetectedTextBlockAlignment.Center => "center", + DetectedTextBlockAlignment.Left => "left", + DetectedTextBlockAlignment.Right => "right", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DetectedTextBlockAlignment? ToEnum(string value) + { + return value switch + { + "center" => DetectedTextBlockAlignment.Center, + "left" => DetectedTextBlockAlignment.Left, + "right" => DetectedTextBlockAlignment.Right, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItem.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItem.g.cs new file mode 100644 index 0000000..3a67fd6 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockFormattingItem.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public enum DetectedTextBlockFormattingItem + { + /// + /// + /// + AllCaps, + /// + /// + /// + Bold, + /// + /// + /// + Italic, + /// + /// + /// + SmallCaps, + /// + /// + /// + Strikethrough, + /// + /// + /// + Subscript, + /// + /// + /// + Superscript, + /// + /// + /// + Underline, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DetectedTextBlockFormattingItemExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DetectedTextBlockFormattingItem value) + { + return value switch + { + DetectedTextBlockFormattingItem.AllCaps => "all_caps", + DetectedTextBlockFormattingItem.Bold => "bold", + DetectedTextBlockFormattingItem.Italic => "italic", + DetectedTextBlockFormattingItem.SmallCaps => "small_caps", + DetectedTextBlockFormattingItem.Strikethrough => "strikethrough", + DetectedTextBlockFormattingItem.Subscript => "subscript", + DetectedTextBlockFormattingItem.Superscript => "superscript", + DetectedTextBlockFormattingItem.Underline => "underline", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DetectedTextBlockFormattingItem? ToEnum(string value) + { + return value switch + { + "all_caps" => DetectedTextBlockFormattingItem.AllCaps, + "bold" => DetectedTextBlockFormattingItem.Bold, + "italic" => DetectedTextBlockFormattingItem.Italic, + "small_caps" => DetectedTextBlockFormattingItem.SmallCaps, + "strikethrough" => DetectedTextBlockFormattingItem.Strikethrough, + "subscript" => DetectedTextBlockFormattingItem.Subscript, + "superscript" => DetectedTextBlockFormattingItem.Superscript, + "underline" => DetectedTextBlockFormattingItem.Underline, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockRole.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockRole.g.cs new file mode 100644 index 0000000..ce69171 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.DetectedTextBlockRole.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// Inferred typographic role of this text block. + /// + public enum DetectedTextBlockRole + { + /// + /// + /// + Body, + /// + /// + /// + Caption, + /// + /// + /// + Heading, + /// + /// + /// + Subheading, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DetectedTextBlockRoleExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DetectedTextBlockRole value) + { + return value switch + { + DetectedTextBlockRole.Body => "body", + DetectedTextBlockRole.Caption => "caption", + DetectedTextBlockRole.Heading => "heading", + DetectedTextBlockRole.Subheading => "subheading", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DetectedTextBlockRole? ToEnum(string value) + { + return value switch + { + "body" => DetectedTextBlockRole.Body, + "caption" => DetectedTextBlockRole.Caption, + "heading" => DetectedTextBlockRole.Heading, + "subheading" => DetectedTextBlockRole.Subheading, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.Json.g.cs new file mode 100644 index 0000000..624c248 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class LayerizeTextRequest + { + /// + /// 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.LayerizeTextRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.LayerizeTextRequest), + jsonSerializerContext) as global::Ideogram.LayerizeTextRequest; + } + + /// + /// 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.LayerizeTextRequest? 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.LayerizeTextRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizeTextRequest; + } + + /// + /// 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.LayerizeTextRequest.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.g.cs new file mode 100644 index 0000000..cffe793 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextRequest.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// + /// + public sealed partial class LayerizeTextRequest + { + /// + /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 10MB). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required byte[] Image { get; set; } + + /// + /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 10MB). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Imagename { get; set; } + + /// + /// An optional text description of the image. If not provided, a description will be auto-generated from the image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + /// + /// Random seed. Set for reproducible generation.
+ /// Example: 12345 + ///
+ /// 12345 + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 10MB). + /// + /// + /// The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 10MB). + /// + /// + /// An optional text description of the image. If not provided, a description will be auto-generated from the image. + /// + /// + /// Random seed. Set for reproducible generation.
+ /// Example: 12345 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public LayerizeTextRequest( + byte[] image, + string imagename, + string? prompt, + int? seed) + { + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); + this.Prompt = prompt; + this.Seed = seed; + } + + /// + /// Initializes a new instance of the class. + /// + public LayerizeTextRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.Json.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.Json.g.cs new file mode 100644 index 0000000..f43ad08 --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Ideogram +{ + public sealed partial class LayerizeTextResponse + { + /// + /// 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.LayerizeTextResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Ideogram.LayerizeTextResponse), + jsonSerializerContext) as global::Ideogram.LayerizeTextResponse; + } + + /// + /// 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.LayerizeTextResponse? 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.LayerizeTextResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Ideogram.LayerizeTextResponse; + } + + /// + /// 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.LayerizeTextResponse.g.cs b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.g.cs new file mode 100644 index 0000000..00f718c --- /dev/null +++ b/src/libs/Ideogram/Generated/Ideogram.Models.LayerizeTextResponse.g.cs @@ -0,0 +1,86 @@ + +#nullable enable + +namespace Ideogram +{ + /// + /// The response containing detected text blocks and a text-erased base image.
+ /// Image links are available for a limited period of time; if you would like to keep the image, you must download it.
+ /// Example: {"original_image_url":"https://openapi-generator.tech","seed":12345,"base_image_url":"https://openapi-generator.tech","text_blocks":[{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5},{"role":"heading","color":"#212121","font_alternatives":["font_alternatives","font_alternatives"],"font_size":2,"font_name":"font_name","line_height":7.0614014,"x":0,"width":1,"y":6,"angle":5.637377,"text":"Hello World","alignment":"left","formatting":["bold","bold"],"height":5}]} + ///
+ public sealed partial class LayerizeTextResponse + { + /// + /// URL of the image with all detected text removed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("base_image_url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string BaseImageUrl { get; set; } + + /// + /// URL of the original image with text intact. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("original_image_url")] + public string? OriginalImageUrl { get; set; } + + /// + /// Flat list of detected text regions in the image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text_blocks")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList TextBlocks { get; set; } + + /// + /// Random seed. Set for reproducible generation.
+ /// Example: 12345 + ///
+ /// 12345 + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Seed { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// URL of the image with all detected text removed. + /// + /// + /// Flat list of detected text regions in the image. + /// + /// + /// Random seed. Set for reproducible generation.
+ /// Example: 12345 + /// + /// + /// URL of the original image with text intact. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public LayerizeTextResponse( + string baseImageUrl, + global::System.Collections.Generic.IList textBlocks, + int seed, + string? originalImageUrl) + { + this.BaseImageUrl = baseImageUrl ?? throw new global::System.ArgumentNullException(nameof(baseImageUrl)); + this.OriginalImageUrl = originalImageUrl; + this.TextBlocks = textBlocks ?? throw new global::System.ArgumentNullException(nameof(textBlocks)); + this.Seed = seed; + } + + /// + /// Initializes a new instance of the class. + /// + public LayerizeTextResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Ideogram/openapi.json b/src/libs/Ideogram/openapi.json index 025d491..f3de263 100644 --- a/src/libs/Ideogram/openapi.json +++ b/src/libs/Ideogram/openapi.json @@ -2749,6 +2749,50 @@ "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" } }, + "/v1/ideogram-v3/layerize-text": { + "post": { + "description": "Analyzes an image to detect text regions, then returns each detected text block with its position, content, font information, and styling.\n\nThe response includes a text-erased base image (background with all text removed) and a flat list of detected text blocks.\n\nSupported image formats include JPEG, PNG, and WebP (max size 10MB).\n\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.\n", + "operationId": "post_layerize_text_v3", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/LayerizeTextRequest" + } + } + }, + "description": "A request to detect and extract text layers from an image.", + "required": true, + "x-body-name": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LayerizeTextResponse" + } + } + }, + "description": "Text layers detected and extracted successfully." + }, + "400": { + "description": "Invalid input provided." + }, + "401": { + "description": "Not authorized." + }, + "429": { + "description": "Too many requests." + } + }, + "summary": "Detect and extract text layers from an image", + "tags": [ + "generate" + ], + "x-openapi-router-controller": "external_api.generated.openapi.controllers.generate_controller" + } + }, "/v1/ideogram-v3/reframe": { "post": { "description": "Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.\n\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.\n", @@ -5894,6 +5938,265 @@ "title": "ImageLayerV3", "type": "object" }, + "LayerizeTextRequest": { + "properties": { + "image": { + "description": "The image to analyze for text detection. The image should be in JPEG, PNG, or WebP format (max size 10MB).", + "format": "binary", + "type": "string" + }, + "prompt": { + "description": "An optional text description of the image. If not provided, a description will be auto-generated from the image.", + "type": "string" + }, + "seed": { + "$ref": "#/components/schemas/Seed" + } + }, + "required": [ + "image" + ], + "type": "object" + }, + "LayerizeTextResponse": { + "description": "The response containing detected text blocks and a text-erased base image.\n\nImage links are available for a limited period of time; if you would like to keep the image, you must download it.\n", + "example": { + "original_image_url": "https://openapi-generator.tech", + "seed": 12345, + "base_image_url": "https://openapi-generator.tech", + "text_blocks": [ + { + "role": "heading", + "color": "#212121", + "font_alternatives": [ + "font_alternatives", + "font_alternatives" + ], + "font_size": 2, + "font_name": "font_name", + "line_height": 7.0614014, + "x": 0, + "width": 1, + "y": 6, + "angle": 5.637377, + "text": "Hello World", + "alignment": "left", + "formatting": [ + "bold", + "bold" + ], + "height": 5 + }, + { + "role": "heading", + "color": "#212121", + "font_alternatives": [ + "font_alternatives", + "font_alternatives" + ], + "font_size": 2, + "font_name": "font_name", + "line_height": 7.0614014, + "x": 0, + "width": 1, + "y": 6, + "angle": 5.637377, + "text": "Hello World", + "alignment": "left", + "formatting": [ + "bold", + "bold" + ], + "height": 5 + } + ] + }, + "properties": { + "base_image_url": { + "description": "URL of the image with all detected text removed.", + "format": "uri", + "title": "base_image_url", + "type": "string" + }, + "original_image_url": { + "description": "URL of the original image with text intact.", + "format": "uri", + "nullable": true, + "title": "original_image_url", + "type": "string" + }, + "text_blocks": { + "description": "Flat list of detected text regions in the image.", + "items": { + "$ref": "#/components/schemas/DetectedTextBlock" + }, + "title": "text_blocks", + "type": "array" + }, + "seed": { + "description": "Random seed. Set for reproducible generation.", + "example": 12345, + "maximum": 2147483647, + "minimum": 0, + "title": "Seed", + "type": "integer" + } + }, + "required": [ + "base_image_url", + "seed", + "text_blocks" + ], + "title": "LayerizeTextResponse", + "type": "object" + }, + "DetectedTextBlock": { + "description": "A single detected text region with its position, content, font information, and styling.", + "example": { + "role": "heading", + "color": "#212121", + "font_alternatives": [ + "font_alternatives", + "font_alternatives" + ], + "font_size": 2, + "font_name": "font_name", + "line_height": 7.0614014, + "x": 0, + "width": 1, + "y": 6, + "angle": 5.637377, + "text": "Hello World", + "alignment": "left", + "formatting": [ + "bold", + "bold" + ], + "height": 5 + }, + "properties": { + "x": { + "description": "X coordinate in pixels from the top-left corner.", + "title": "x", + "type": "integer" + }, + "y": { + "description": "Y coordinate in pixels from the top-left corner.", + "title": "y", + "type": "integer" + }, + "width": { + "description": "Width of the text region in pixels.", + "title": "width", + "type": "integer" + }, + "height": { + "description": "Height of the text region in pixels.", + "title": "height", + "type": "integer" + }, + "text": { + "description": "The detected text content. Line breaks are represented as \\n.", + "example": "Hello World", + "title": "text", + "type": "string" + }, + "alignment": { + "description": "Detected text alignment.", + "enum": [ + "left", + "center", + "right" + ], + "title": "alignment", + "type": "string" + }, + "angle": { + "default": 0, + "description": "Rotation angle in degrees (clockwise). Defaults to 0.", + "format": "float", + "title": "angle", + "type": "number" + }, + "font_name": { + "description": "Best-matching font name from the font library.", + "nullable": true, + "title": "font_name", + "type": "string" + }, + "font_alternatives": { + "description": "Alternative font matches, ranked by similarity.", + "items": { + "type": "string" + }, + "nullable": true, + "title": "font_alternatives", + "type": "array" + }, + "font_size": { + "description": "Detected font size in points.", + "nullable": true, + "title": "font_size", + "type": "integer" + }, + "line_height": { + "description": "Line height multiplier (e.g., 1.2).", + "format": "float", + "nullable": true, + "title": "line_height", + "type": "number" + }, + "color": { + "description": "Detected text color in hex format.", + "example": "#212121", + "nullable": true, + "pattern": "^#[0-9A-Fa-f]{6}$", + "title": "color", + "type": "string" + }, + "formatting": { + "description": "Detected text formatting effects.", + "items": { + "enum": [ + "bold", + "italic", + "underline", + "strikethrough", + "all_caps", + "small_caps", + "superscript", + "subscript" + ], + "type": "string" + }, + "title": "formatting", + "type": "array" + }, + "role": { + "description": "Inferred typographic role of this text block.", + "enum": [ + "heading", + "subheading", + "body", + "caption" + ], + "nullable": true, + "title": "role", + "type": "string" + } + }, + "required": [ + "alignment", + "formatting", + "height", + "text", + "width", + "x", + "y" + ], + "title": "DetectedTextBlock", + "type": "object" + }, "InternalBatchResultsResponse": { "description": "A response for batch magic prompt job results.", "example": {