diff --git a/src/libs/Writer/Generated/Writer.ITranslationClient.CreateTranslation.g.cs b/src/libs/Writer/Generated/Writer.ITranslationClient.CreateTranslation.g.cs
deleted file mode 100644
index 0e3f136..0000000
--- a/src/libs/Writer/Generated/Writer.ITranslationClient.CreateTranslation.g.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-#nullable enable
-
-namespace Writer
-{
- public partial interface ITranslationClient
- {
- ///
- /// Translate text
- /// Translate text from one language to another.
- ///
- ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
- /// The token to cancel the operation with
- ///
- ///
- /// curl --location --request POST https://api.writer.com/v1/translation \
- /// --header "Authorization: Bearer <token>" \
- /// --header "Content-Type: application/json" \
- /// --data-raw '{"model":"string","source_language_code":"string","target_language_code":"string","text":"string","formality":false,"length_control":false,"mask_profanity":false}'
- ///
- global::System.Threading.Tasks.Task CreateTranslationAsync(
-
- global::Writer.TranslationRequest request,
- global::Writer.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default);
- ///
- /// Translate text
- /// Translate text from one language to another.
- ///
- ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
- /// The token to cancel the operation with
- ///
- ///
- /// curl --location --request POST https://api.writer.com/v1/translation \
- /// --header "Authorization: Bearer <token>" \
- /// --header "Content-Type: application/json" \
- /// --data-raw '{"model":"string","source_language_code":"string","target_language_code":"string","text":"string","formality":false,"length_control":false,"mask_profanity":false}'
- ///
- global::System.Threading.Tasks.Task> CreateTranslationAsResponseAsync(
-
- global::Writer.TranslationRequest request,
- global::Writer.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default);
- ///
- /// Translate text
- /// Translate text from one language to another.
- ///
- ///
- /// The model to use for translation.
- ///
- ///
- /// The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the original text to translate. For example, `en` for English, `zh` for Chinese, `fr` for French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish is `es-MX`. See the [list of supported languages and language codes](https://dev.writer.com/api-reference/translation-api/language-support).
- ///
- ///
- /// The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the target language for the translation. For example, `en` for English, `zh` for Chinese, `fr` for French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish is `es-MX`. See the [list of supported languages and language codes](https://dev.writer.com/api-reference/translation-api/language-support).
- ///
- ///
- /// The text to translate. Maximum of 100,000 words.
- ///
- ///
- /// Whether to use formal or informal language in the translation. See the [list of languages that support formality](https://dev.writer.com/api-reference/translation-api/language-support#formality). If the language does not support formality, this parameter is ignored.
- ///
- ///
- /// Whether to control the length of the translated text. See the [list of languages that support length control](https://dev.writer.com/api-reference/translation-api/language-support#length-control). If the language does not support length control, this parameter is ignored.
- ///
- ///
- /// Whether to mask profane words in the translated text. See the [list of languages that do not support profanity masking](https://dev.writer.com/api-reference/translation-api/language-support#profanity-masking). If the language does not support profanity masking, this parameter is ignored.
- ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
- /// The token to cancel the operation with
- ///
- global::System.Threading.Tasks.Task CreateTranslationAsync(
- string sourceLanguageCode,
- string targetLanguageCode,
- string text,
- bool formality,
- bool lengthControl,
- bool maskProfanity,
- global::Writer.TranslationRequestModel model = default,
- global::Writer.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default);
- }
-}
\ No newline at end of file
diff --git a/src/libs/Writer/Generated/Writer.ITranslationClient.g.cs b/src/libs/Writer/Generated/Writer.ITranslationClient.g.cs
deleted file mode 100644
index dc6adc6..0000000
--- a/src/libs/Writer/Generated/Writer.ITranslationClient.g.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-
-#nullable enable
-
-namespace Writer
-{
- ///
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
- ///
- public partial interface ITranslationClient : global::System.IDisposable
- {
- ///
- /// The HttpClient instance.
- ///
- public global::System.Net.Http.HttpClient HttpClient { get; }
-
- ///
- /// The base URL for the API.
- ///
- public System.Uri? BaseUri { get; }
-
- ///
- /// The authorizations to use for the requests.
- ///
- 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.
- /// When false, successful responses are deserialized directly from the response stream for better performance.
- /// Error responses are always read as strings regardless of this setting,
- /// ensuring is populated.
- ///
- public bool ReadResponseAsString { get; set; }
- ///
- /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
- ///
- public global::Writer.AutoSDKClientOptions Options { get; }
-
-
- ///
- ///
- ///
- global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; }
-
-
- }
-}
\ No newline at end of file
diff --git a/src/libs/Writer/Generated/Writer.IWriterClient.g.cs b/src/libs/Writer/Generated/Writer.IWriterClient.g.cs
index f6c5609..499b752 100644
--- a/src/libs/Writer/Generated/Writer.IWriterClient.g.cs
+++ b/src/libs/Writer/Generated/Writer.IWriterClient.g.cs
@@ -69,11 +69,6 @@ public partial interface IWriterClient : global::System.IDisposable
///
public ToolsApiClient ToolsApi { get; }
- ///
- ///
- ///
- public TranslationClient Translation { get; }
-
///
///
///
diff --git a/src/libs/Writer/Generated/Writer.JsonConverters.TranslationRequestModel.g.cs b/src/libs/Writer/Generated/Writer.JsonConverters.TranslationRequestModel.g.cs
deleted file mode 100644
index 7cf9ded..0000000
--- a/src/libs/Writer/Generated/Writer.JsonConverters.TranslationRequestModel.g.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-#nullable enable
-
-namespace Writer.JsonConverters
-{
- ///
- public sealed class TranslationRequestModelJsonConverter : global::System.Text.Json.Serialization.JsonConverter
- {
- ///
- public override global::Writer.TranslationRequestModel 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::Writer.TranslationRequestModelExtensions.ToEnum(stringValue) ?? default;
- }
-
- break;
- }
- case global::System.Text.Json.JsonTokenType.Number:
- {
- var numValue = reader.GetInt32();
- return (global::Writer.TranslationRequestModel)numValue;
- }
- case global::System.Text.Json.JsonTokenType.Null:
- {
- return default(global::Writer.TranslationRequestModel);
- }
- default:
- throw new global::System.ArgumentOutOfRangeException(nameof(reader));
- }
-
- return default;
- }
-
- ///
- public override void Write(
- global::System.Text.Json.Utf8JsonWriter writer,
- global::Writer.TranslationRequestModel value,
- global::System.Text.Json.JsonSerializerOptions options)
- {
- writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
-
- writer.WriteStringValue(global::Writer.TranslationRequestModelExtensions.ToValueString(value));
- }
- }
-}
diff --git a/src/libs/Writer/Generated/Writer.JsonConverters.TranslationRequestModelNullable.g.cs b/src/libs/Writer/Generated/Writer.JsonConverters.TranslationRequestModelNullable.g.cs
deleted file mode 100644
index f18ffcd..0000000
--- a/src/libs/Writer/Generated/Writer.JsonConverters.TranslationRequestModelNullable.g.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-#nullable enable
-
-namespace Writer.JsonConverters
-{
- ///
- public sealed class TranslationRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
- {
- ///
- public override global::Writer.TranslationRequestModel? 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::Writer.TranslationRequestModelExtensions.ToEnum(stringValue);
- }
-
- break;
- }
- case global::System.Text.Json.JsonTokenType.Number:
- {
- var numValue = reader.GetInt32();
- return (global::Writer.TranslationRequestModel)numValue;
- }
- case global::System.Text.Json.JsonTokenType.Null:
- {
- return default(global::Writer.TranslationRequestModel?);
- }
- default:
- throw new global::System.ArgumentOutOfRangeException(nameof(reader));
- }
-
- return default;
- }
-
- ///
- public override void Write(
- global::System.Text.Json.Utf8JsonWriter writer,
- global::Writer.TranslationRequestModel? 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::Writer.TranslationRequestModelExtensions.ToValueString(value.Value));
- }
- }
- }
-}
diff --git a/src/libs/Writer/Generated/Writer.JsonSerializerContext.g.cs b/src/libs/Writer/Generated/Writer.JsonSerializerContext.g.cs
index ad360ca..08b9a9f 100644
--- a/src/libs/Writer/Generated/Writer.JsonSerializerContext.g.cs
+++ b/src/libs/Writer/Generated/Writer.JsonSerializerContext.g.cs
@@ -125,10 +125,6 @@ namespace Writer
typeof(global::Writer.JsonConverters.VisionRequestModelNullableJsonConverter),
- typeof(global::Writer.JsonConverters.TranslationRequestModelJsonConverter),
-
- typeof(global::Writer.JsonConverters.TranslationRequestModelNullableJsonConverter),
-
typeof(global::Writer.JsonConverters.TranslationToolTypeJsonConverter),
typeof(global::Writer.JsonConverters.TranslationToolTypeNullableJsonConverter),
@@ -373,9 +369,6 @@ namespace Writer
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.VisionRequestFileVariable))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.VisionResponse))]
- [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.TranslationRequest))]
- [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.TranslationRequestModel), TypeInfoPropertyName = "TranslationRequestModel2")]
- [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.TranslationResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.TranslationToolType), TypeInfoPropertyName = "TranslationToolType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.TranslationFunction))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Writer.TranslationFunctionModel), TypeInfoPropertyName = "TranslationFunctionModel2")]
diff --git a/src/libs/Writer/Generated/Writer.JsonSerializerContextTypes.g.cs b/src/libs/Writer/Generated/Writer.JsonSerializerContextTypes.g.cs
index 8c4d9a7..e1e2bfb 100644
--- a/src/libs/Writer/Generated/Writer.JsonSerializerContextTypes.g.cs
+++ b/src/libs/Writer/Generated/Writer.JsonSerializerContextTypes.g.cs
@@ -704,143 +704,131 @@ public sealed partial class JsonSerializerContextTypes
///
///
///
- public global::Writer.TranslationRequest? Type169 { get; set; }
+ public global::Writer.TranslationToolType? Type169 { get; set; }
///
///
///
- public global::Writer.TranslationRequestModel? Type170 { get; set; }
+ public global::Writer.TranslationFunction? Type170 { get; set; }
///
///
///
- public global::Writer.TranslationResponse? Type171 { get; set; }
+ public global::Writer.TranslationFunctionModel? Type171 { get; set; }
///
///
///
- public global::Writer.TranslationToolType? Type172 { get; set; }
+ public global::Writer.WebSearchRequest? Type172 { get; set; }
///
///
///
- public global::Writer.TranslationFunction? Type173 { get; set; }
+ public global::Writer.WebSearchRequestTopic? Type173 { get; set; }
///
///
///
- public global::Writer.TranslationFunctionModel? Type174 { get; set; }
+ public global::Writer.WebSearchRequestSearchDepth? Type174 { get; set; }
///
///
///
- public global::Writer.WebSearchRequest? Type175 { get; set; }
+ public global::Writer.WebSearchRequestTimeRange? Type175 { get; set; }
///
///
///
- public global::Writer.WebSearchRequestTopic? Type176 { get; set; }
+ public global::Writer.OneOf? Type176 { get; set; }
///
///
///
- public global::Writer.WebSearchRequestSearchDepth? Type177 { get; set; }
+ public global::Writer.WebSearchRequestIncludeRawContent? Type177 { get; set; }
///
///
///
- public global::Writer.WebSearchRequestTimeRange? Type178 { get; set; }
+ public global::Writer.WebSearchRequestCountry? Type178 { get; set; }
///
///
///
- public global::Writer.OneOf? Type179 { get; set; }
+ public global::Writer.WebSearchResponse? Type179 { get; set; }
///
///
///
- public global::Writer.WebSearchRequestIncludeRawContent? Type180 { get; set; }
+ public global::System.Collections.Generic.IList? Type180 { get; set; }
///
///
///
- public global::Writer.WebSearchRequestCountry? Type181 { get; set; }
+ public global::Writer.WebSearchResponseSource? Type181 { get; set; }
///
///
///
- public global::Writer.WebSearchResponse? Type182 { get; set; }
+ public global::Writer.WebSearchToolType? Type182 { get; set; }
///
///
///
- public global::System.Collections.Generic.IList? Type183 { get; set; }
+ public global::Writer.WebSearchFunction? Type183 { get; set; }
///
///
///
- public global::Writer.WebSearchResponseSource? Type184 { get; set; }
+ public global::Writer.TextFragment? Type184 { get; set; }
///
///
///
- public global::Writer.WebSearchToolType? Type185 { get; set; }
+ public global::Writer.ImageFragment? Type185 { get; set; }
///
///
///
- public global::Writer.WebSearchFunction? Type186 { get; set; }
+ public global::Writer.TextFragmentType? Type186 { get; set; }
///
///
///
- public global::Writer.TextFragment? Type187 { get; set; }
+ public global::Writer.ImageFragmentType? Type187 { get; set; }
///
///
///
- public global::Writer.ImageFragment? Type188 { get; set; }
+ public global::Writer.ImageFragmentImageUrl? Type188 { get; set; }
///
///
///
- public global::Writer.TextFragmentType? Type189 { get; set; }
+ public global::System.Collections.Generic.IList? Type189 { get; set; }
///
///
///
- public global::Writer.ImageFragmentType? Type190 { get; set; }
+ public global::Writer.File? Type190 { get; set; }
///
///
///
- public global::Writer.ImageFragmentImageUrl? Type191 { get; set; }
+ public global::System.Collections.Generic.IList? Type191 { get; set; }
///
///
///
- public global::System.Collections.Generic.IList? Type192 { get; set; }
+ public global::Writer.Web? Type192 { get; set; }
///
///
///
- public global::Writer.File? Type193 { get; set; }
+ public byte[]? Type193 { get; set; }
///
///
///
- public global::System.Collections.Generic.IList? Type194 { get; set; }
+ public global::Writer.FindGraphsWithFileStatusOrder? Type194 { get; set; }
///
///
///
- public global::Writer.Web? Type195 { get; set; }
+ public global::Writer.GatewayGetFilesOrder? Type195 { get; set; }
///
///
///
- public byte[]? Type196 { get; set; }
+ public global::Writer.GatewayGetFilesStatus? Type196 { get; set; }
///
///
///
- public global::Writer.FindGraphsWithFileStatusOrder? Type197 { get; set; }
+ public global::Writer.GetApplicationsOrder? Type197 { get; set; }
///
///
///
- public global::Writer.GatewayGetFilesOrder? Type198 { get; set; }
+ public global::System.Collections.Generic.IList? Type198 { get; set; }
///
///
///
- public global::Writer.GatewayGetFilesStatus? Type199 { get; set; }
+ public global::System.Collections.Generic.IList? Type199 { get; set; }
///
///
///
- public global::Writer.GetApplicationsOrder? Type200 { get; set; }
- ///
- ///
- ///
- public global::System.Collections.Generic.IList? Type201 { get; set; }
- ///
- ///
- ///
- public global::System.Collections.Generic.IList? Type202 { get; set; }
- ///
- ///
- ///
- public global::System.Collections.Generic.IList? Type203 { get; set; }
+ public global::System.Collections.Generic.IList? Type200 { get; set; }
///
///
diff --git a/src/libs/Writer/Generated/Writer.Models.TranslationRequest.Json.g.cs b/src/libs/Writer/Generated/Writer.Models.TranslationRequest.Json.g.cs
deleted file mode 100644
index 9b26898..0000000
--- a/src/libs/Writer/Generated/Writer.Models.TranslationRequest.Json.g.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-#nullable enable
-
-namespace Writer
-{
- public sealed partial class TranslationRequest
- {
- ///
- /// 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 generated default JsonSerializerContext.
- ///
- public string ToJson()
- {
- return ToJson(global::Writer.SourceGenerationContext.Default);
- }
-
- ///
- /// 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)
- {
- if (jsonSerializerOptions is null)
- {
- return ToJson(global::Writer.SourceGenerationContext.Default);
- }
-
- return global::System.Text.Json.JsonSerializer.Serialize(
- this,
- jsonSerializerOptions);
- }
-
- ///
- /// Deserializes a JSON string using the provided JsonSerializerContext.
- ///
- public static global::Writer.TranslationRequest? FromJson(
- string json,
- global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
- {
- return global::System.Text.Json.JsonSerializer.Deserialize(
- json,
- typeof(global::Writer.TranslationRequest),
- jsonSerializerContext) as global::Writer.TranslationRequest;
- }
-
- ///
- /// Deserializes a JSON string using the generated default JsonSerializerContext.
- ///
- public static global::Writer.TranslationRequest? FromJson(
- string json)
- {
- return FromJson(
- json,
- global::Writer.SourceGenerationContext.Default);
- }
-
- ///
- /// 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::Writer.TranslationRequest? FromJson(
- string json,
- global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
- {
- if (jsonSerializerOptions is null)
- {
- return FromJson(
- json,
- global::Writer.SourceGenerationContext.Default);
- }
-
- 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::Writer.TranslationRequest),
- jsonSerializerContext).ConfigureAwait(false)) as global::Writer.TranslationRequest;
- }
-
- ///
- /// Deserializes a JSON stream using the generated default JsonSerializerContext.
- ///
- public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync(
- global::System.IO.Stream jsonStream)
- {
- return FromJsonStreamAsync(
- jsonStream,
- global::Writer.SourceGenerationContext.Default);
- }
-
- ///
- /// 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)
- {
- if (jsonSerializerOptions is null)
- {
- return FromJsonStreamAsync(
- jsonStream,
- global::Writer.SourceGenerationContext.Default);
- }
-
- return global::System.Text.Json.JsonSerializer.DeserializeAsync(
- jsonStream,
- jsonSerializerOptions);
- }
- }
-}
diff --git a/src/libs/Writer/Generated/Writer.Models.TranslationRequest.g.cs b/src/libs/Writer/Generated/Writer.Models.TranslationRequest.g.cs
deleted file mode 100644
index 19a3df3..0000000
--- a/src/libs/Writer/Generated/Writer.Models.TranslationRequest.g.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-
-#nullable enable
-
-namespace Writer
-{
- ///
- ///
- ///
- public sealed partial class TranslationRequest
- {
- ///
- /// The model to use for translation.
- ///
- [global::System.Text.Json.Serialization.JsonPropertyName("model")]
- [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Writer.JsonConverters.TranslationRequestModelJsonConverter))]
- public global::Writer.TranslationRequestModel Model { get; set; }
-
- ///
- /// The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the original text to translate. For example, `en` for English, `zh` for Chinese, `fr` for French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish is `es-MX`. See the [list of supported languages and language codes](https://dev.writer.com/api-reference/translation-api/language-support).
- ///
- [global::System.Text.Json.Serialization.JsonPropertyName("source_language_code")]
- [global::System.Text.Json.Serialization.JsonRequired]
- public required string SourceLanguageCode { get; set; }
-
- ///
- /// The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the target language for the translation. For example, `en` for English, `zh` for Chinese, `fr` for French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish is `es-MX`. See the [list of supported languages and language codes](https://dev.writer.com/api-reference/translation-api/language-support).
- ///
- [global::System.Text.Json.Serialization.JsonPropertyName("target_language_code")]
- [global::System.Text.Json.Serialization.JsonRequired]
- public required string TargetLanguageCode { get; set; }
-
- ///
- /// The text to translate. Maximum of 100,000 words.
- ///
- [global::System.Text.Json.Serialization.JsonPropertyName("text")]
- [global::System.Text.Json.Serialization.JsonRequired]
- public required string Text { get; set; }
-
- ///
- /// Whether to use formal or informal language in the translation. See the [list of languages that support formality](https://dev.writer.com/api-reference/translation-api/language-support#formality). If the language does not support formality, this parameter is ignored.
- ///
- [global::System.Text.Json.Serialization.JsonPropertyName("formality")]
- [global::System.Text.Json.Serialization.JsonRequired]
- public required bool Formality { get; set; }
-
- ///
- /// Whether to control the length of the translated text. See the [list of languages that support length control](https://dev.writer.com/api-reference/translation-api/language-support#length-control). If the language does not support length control, this parameter is ignored.
- ///
- [global::System.Text.Json.Serialization.JsonPropertyName("length_control")]
- [global::System.Text.Json.Serialization.JsonRequired]
- public required bool LengthControl { get; set; }
-
- ///
- /// Whether to mask profane words in the translated text. See the [list of languages that do not support profanity masking](https://dev.writer.com/api-reference/translation-api/language-support#profanity-masking). If the language does not support profanity masking, this parameter is ignored.
- ///
- [global::System.Text.Json.Serialization.JsonPropertyName("mask_profanity")]
- [global::System.Text.Json.Serialization.JsonRequired]
- public required bool MaskProfanity { 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 [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the original text to translate. For example, `en` for English, `zh` for Chinese, `fr` for French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish is `es-MX`. See the [list of supported languages and language codes](https://dev.writer.com/api-reference/translation-api/language-support).
- ///
- ///
- /// The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the target language for the translation. For example, `en` for English, `zh` for Chinese, `fr` for French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish is `es-MX`. See the [list of supported languages and language codes](https://dev.writer.com/api-reference/translation-api/language-support).
- ///
- ///
- /// The text to translate. Maximum of 100,000 words.
- ///
- ///
- /// Whether to use formal or informal language in the translation. See the [list of languages that support formality](https://dev.writer.com/api-reference/translation-api/language-support#formality). If the language does not support formality, this parameter is ignored.
- ///
- ///
- /// Whether to control the length of the translated text. See the [list of languages that support length control](https://dev.writer.com/api-reference/translation-api/language-support#length-control). If the language does not support length control, this parameter is ignored.
- ///
- ///
- /// Whether to mask profane words in the translated text. See the [list of languages that do not support profanity masking](https://dev.writer.com/api-reference/translation-api/language-support#profanity-masking). If the language does not support profanity masking, this parameter is ignored.
- ///
- ///
- /// The model to use for translation.
- ///
-#if NET7_0_OR_GREATER
- [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
-#endif
- public TranslationRequest(
- string sourceLanguageCode,
- string targetLanguageCode,
- string text,
- bool formality,
- bool lengthControl,
- bool maskProfanity,
- global::Writer.TranslationRequestModel model)
- {
- this.Model = model;
- this.SourceLanguageCode = sourceLanguageCode ?? throw new global::System.ArgumentNullException(nameof(sourceLanguageCode));
- this.TargetLanguageCode = targetLanguageCode ?? throw new global::System.ArgumentNullException(nameof(targetLanguageCode));
- this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text));
- this.Formality = formality;
- this.LengthControl = lengthControl;
- this.MaskProfanity = maskProfanity;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- public TranslationRequest()
- {
- }
-
- }
-}
\ No newline at end of file
diff --git a/src/libs/Writer/Generated/Writer.Models.TranslationRequestModel.g.cs b/src/libs/Writer/Generated/Writer.Models.TranslationRequestModel.g.cs
deleted file mode 100644
index 33a2c80..0000000
--- a/src/libs/Writer/Generated/Writer.Models.TranslationRequestModel.g.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-
-#nullable enable
-
-namespace Writer
-{
- ///
- /// The model to use for translation.
- ///
- public enum TranslationRequestModel
- {
- ///
- ///
- ///
- PalmyraTranslate,
- }
-
- ///
- /// Enum extensions to do fast conversions without the reflection.
- ///
- public static class TranslationRequestModelExtensions
- {
- ///
- /// Converts an enum to a string.
- ///
- public static string ToValueString(this TranslationRequestModel value)
- {
- return value switch
- {
- TranslationRequestModel.PalmyraTranslate => "palmyra-translate",
- _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
- };
- }
- ///
- /// Converts an string to a enum.
- ///
- public static TranslationRequestModel? ToEnum(string value)
- {
- return value switch
- {
- "palmyra-translate" => TranslationRequestModel.PalmyraTranslate,
- _ => null,
- };
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/Writer/Generated/Writer.Models.TranslationResponse.Json.g.cs b/src/libs/Writer/Generated/Writer.Models.TranslationResponse.Json.g.cs
deleted file mode 100644
index e01666b..0000000
--- a/src/libs/Writer/Generated/Writer.Models.TranslationResponse.Json.g.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-#nullable enable
-
-namespace Writer
-{
- public sealed partial class TranslationResponse
- {
- ///
- /// 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 generated default JsonSerializerContext.
- ///
- public string ToJson()
- {
- return ToJson(global::Writer.SourceGenerationContext.Default);
- }
-
- ///
- /// 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)
- {
- if (jsonSerializerOptions is null)
- {
- return ToJson(global::Writer.SourceGenerationContext.Default);
- }
-
- return global::System.Text.Json.JsonSerializer.Serialize(
- this,
- jsonSerializerOptions);
- }
-
- ///
- /// Deserializes a JSON string using the provided JsonSerializerContext.
- ///
- public static global::Writer.TranslationResponse? FromJson(
- string json,
- global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
- {
- return global::System.Text.Json.JsonSerializer.Deserialize(
- json,
- typeof(global::Writer.TranslationResponse),
- jsonSerializerContext) as global::Writer.TranslationResponse;
- }
-
- ///
- /// Deserializes a JSON string using the generated default JsonSerializerContext.
- ///
- public static global::Writer.TranslationResponse? FromJson(
- string json)
- {
- return FromJson(
- json,
- global::Writer.SourceGenerationContext.Default);
- }
-
- ///
- /// 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::Writer.TranslationResponse? FromJson(
- string json,
- global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
- {
- if (jsonSerializerOptions is null)
- {
- return FromJson(
- json,
- global::Writer.SourceGenerationContext.Default);
- }
-
- 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::Writer.TranslationResponse),
- jsonSerializerContext).ConfigureAwait(false)) as global::Writer.TranslationResponse;
- }
-
- ///
- /// Deserializes a JSON stream using the generated default JsonSerializerContext.
- ///
- public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync(
- global::System.IO.Stream jsonStream)
- {
- return FromJsonStreamAsync(
- jsonStream,
- global::Writer.SourceGenerationContext.Default);
- }
-
- ///
- /// 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)
- {
- if (jsonSerializerOptions is null)
- {
- return FromJsonStreamAsync(
- jsonStream,
- global::Writer.SourceGenerationContext.Default);
- }
-
- return global::System.Text.Json.JsonSerializer.DeserializeAsync(
- jsonStream,
- jsonSerializerOptions);
- }
- }
-}
diff --git a/src/libs/Writer/Generated/Writer.Models.TranslationResponse.g.cs b/src/libs/Writer/Generated/Writer.Models.TranslationResponse.g.cs
deleted file mode 100644
index 65b6265..0000000
--- a/src/libs/Writer/Generated/Writer.Models.TranslationResponse.g.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-
-#nullable enable
-
-namespace Writer
-{
- ///
- ///
- ///
- public sealed partial class TranslationResponse
- {
- ///
- /// The result of the translation.
- ///
- [global::System.Text.Json.Serialization.JsonPropertyName("data")]
- [global::System.Text.Json.Serialization.JsonRequired]
- public required string Data { 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 result of the translation.
- ///
-#if NET7_0_OR_GREATER
- [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
-#endif
- public TranslationResponse(
- string data)
- {
- this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data));
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- public TranslationResponse()
- {
- }
-
- }
-}
\ No newline at end of file
diff --git a/src/libs/Writer/Generated/Writer.TranslationClient.CreateTranslation.g.cs b/src/libs/Writer/Generated/Writer.TranslationClient.CreateTranslation.g.cs
deleted file mode 100644
index 7a3c87a..0000000
--- a/src/libs/Writer/Generated/Writer.TranslationClient.CreateTranslation.g.cs
+++ /dev/null
@@ -1,504 +0,0 @@
-
-#nullable enable
-
-namespace Writer
-{
- public partial class TranslationClient
- {
-
-
- private static readonly global::Writer.EndPointSecurityRequirement s_CreateTranslationSecurityRequirement0 =
- new global::Writer.EndPointSecurityRequirement
- {
- Authorizations = new global::Writer.EndPointAuthorizationRequirement[]
- { new global::Writer.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "BearerAuth",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::Writer.EndPointSecurityRequirement[] s_CreateTranslationSecurityRequirements =
- new global::Writer.EndPointSecurityRequirement[]
- { s_CreateTranslationSecurityRequirement0,
- };
- partial void PrepareCreateTranslationArguments(
- global::System.Net.Http.HttpClient httpClient,
- global::Writer.TranslationRequest request);
- partial void PrepareCreateTranslationRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::Writer.TranslationRequest request);
- partial void ProcessCreateTranslationResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessCreateTranslationResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Translate text
- /// Translate text from one language to another.
- ///
- ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
- /// The token to cancel the operation with
- ///
- ///
- /// curl --location --request POST https://api.writer.com/v1/translation \
- /// --header "Authorization: Bearer <token>" \
- /// --header "Content-Type: application/json" \
- /// --data-raw '{"model":"string","source_language_code":"string","target_language_code":"string","text":"string","formality":false,"length_control":false,"mask_profanity":false}'
- ///
- public async global::System.Threading.Tasks.Task CreateTranslationAsync(
-
- global::Writer.TranslationRequest request,
- global::Writer.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await CreateTranslationAsResponseAsync(
-
- request: request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Translate text
- /// Translate text from one language to another.
- ///
- ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
- /// The token to cancel the operation with
- ///
- ///
- /// curl --location --request POST https://api.writer.com/v1/translation \
- /// --header "Authorization: Bearer <token>" \
- /// --header "Content-Type: application/json" \
- /// --data-raw '{"model":"string","source_language_code":"string","target_language_code":"string","text":"string","formality":false,"length_control":false,"mask_profanity":false}'
- ///
- public async global::System.Threading.Tasks.Task> CreateTranslationAsResponseAsync(
-
- global::Writer.TranslationRequest request,
- global::Writer.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- request = request ?? throw new global::System.ArgumentNullException(nameof(request));
-
- PrepareArguments(
- client: HttpClient);
- PrepareCreateTranslationArguments(
- httpClient: HttpClient,
- request: request);
-
-
- var __authorizations = global::Writer.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_CreateTranslationSecurityRequirements,
- operationName: "CreateTranslationAsync");
-
- using var __timeoutCancellationTokenSource = global::Writer.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::Writer.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::Writer.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::Writer.PathBuilder(
- path: "/v1/translation",
- baseUri: HttpClient.BaseAddress);
- var __path = __pathBuilder.ToString();
- __path = global::Writer.AutoSDKRequestOptionsSupport.AppendQueryParameters(
- path: __path,
- clientParameters: Options.QueryParameters,
- requestParameters: requestOptions?.QueryParameters);
- 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" ||
- __authorization.Type == "OpenIdConnect")
- {
- __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);
- }
- }
- var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
- var __httpRequestContent = new global::System.Net.Http.StringContent(
- content: __httpRequestContentBody,
- encoding: global::System.Text.Encoding.UTF8,
- mediaType: "application/json");
- __httpRequest.Content = __httpRequestContent;
- global::Writer.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareCreateTranslationRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- request: request);
-
- return __httpRequest;
- }
-
- global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
- global::System.Net.Http.HttpResponseMessage? __response = null;
- var __attemptNumber = 0;
- try
- {
- for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
- {
- __attemptNumber = __attempt;
- __httpRequest = __CreateHttpRequest();
- await global::Writer.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "createTranslation",
- methodName: "CreateTranslationAsync",
- pathTemplate: "\"/v1/translation\"",
- httpMethod: "POST",
- baseUri: BaseUri,
- request: __httpRequest!,
- response: null,
- exception: null,
- clientOptions: Options,
- requestOptions: requestOptions,
- attempt: __attempt,
- maxAttempts: __maxAttempts,
- willRetry: false,
- retryDelay: null,
- retryReason: global::System.String.Empty,
- cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
- try
- {
- __response = await HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "createTranslation",
- methodName: "CreateTranslationAsync",
- pathTemplate: "\"/v1/translation\"",
- httpMethod: "POST",
- baseUri: BaseUri,
- request: __httpRequest!,
- response: null,
- exception: __exception,
- clientOptions: Options,
- requestOptions: requestOptions,
- attempt: __attempt,
- maxAttempts: __maxAttempts,
- willRetry: __willRetry,
- retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
- retryReason: "exception",
- cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
- if (!__willRetry)
- {
- throw;
- }
-
- __httpRequest.Dispose();
- __httpRequest = null;
- await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::Writer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::Writer.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "createTranslation",
- methodName: "CreateTranslationAsync",
- pathTemplate: "\"/v1/translation\"",
- httpMethod: "POST",
- baseUri: BaseUri,
- request: __httpRequest!,
- response: __response,
- exception: null,
- clientOptions: Options,
- requestOptions: requestOptions,
- attempt: __attempt,
- maxAttempts: __maxAttempts,
- willRetry: true,
- retryDelay: __retryDelay,
- retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
- cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
- __response.Dispose();
- __response = null;
- __httpRequest.Dispose();
- __httpRequest = null;
- await global::Writer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- break;
- }
-
- if (__response == null)
- {
- throw new global::System.InvalidOperationException("No response received.");
- }
-
- using (__response)
- {
-
- ProcessResponse(
- client: HttpClient,
- response: __response);
- ProcessCreateTranslationResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::Writer.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "createTranslation",
- methodName: "CreateTranslationAsync",
- pathTemplate: "\"/v1/translation\"",
- httpMethod: "POST",
- baseUri: BaseUri,
- request: __httpRequest!,
- response: __response,
- exception: null,
- clientOptions: Options,
- requestOptions: requestOptions,
- attempt: __attemptNumber,
- maxAttempts: __maxAttempts,
- willRetry: false,
- retryDelay: null,
- retryReason: global::System.String.Empty,
- cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
- }
- else
- {
- await global::Writer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::Writer.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "createTranslation",
- methodName: "CreateTranslationAsync",
- pathTemplate: "\"/v1/translation\"",
- httpMethod: "POST",
- baseUri: BaseUri,
- request: __httpRequest!,
- response: __response,
- exception: null,
- clientOptions: Options,
- requestOptions: requestOptions,
- attempt: __attemptNumber,
- maxAttempts: __maxAttempts,
- willRetry: false,
- retryDelay: null,
- retryReason: global::System.String.Empty,
- cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
- }
-
- if (__effectiveReadResponseAsString)
- {
- var __content = await __response.Content.ReadAsStringAsync(
- #if NET5_0_OR_GREATER
- __effectiveCancellationToken
- #endif
- ).ConfigureAwait(false);
-
- ProcessResponseContent(
- client: HttpClient,
- response: __response,
- content: ref __content);
- ProcessCreateTranslationResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::Writer.TranslationResponse.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::Writer.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::Writer.ApiException.Create(
- statusCode: __response.StatusCode,
- message: __content ?? __response.ReasonPhrase ?? string.Empty,
- innerException: __ex,
- 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
- __effectiveCancellationToken
- #endif
- ).ConfigureAwait(false);
-
- var __value = await global::Writer.TranslationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::Writer.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::Writer.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- string? __content = null;
- try
- {
- __content = await __response.Content.ReadAsStringAsync(
- #if NET5_0_OR_GREATER
- __effectiveCancellationToken
- #endif
- ).ConfigureAwait(false);
- }
- catch (global::System.Exception)
- {
- }
-
- throw global::Writer.ApiException.Create(
- statusCode: __response.StatusCode,
- message: __content ?? __response.ReasonPhrase ?? string.Empty,
- innerException: __ex,
- responseBody: __content,
- responseHeaders: global::System.Linq.Enumerable.ToDictionary(
- __response.Headers,
- h => h.Key,
- h => h.Value));
- }
- }
-
- }
- }
- finally
- {
- __httpRequest?.Dispose();
- }
- }
- ///
- /// Translate text
- /// Translate text from one language to another.
- ///
- ///
- /// The model to use for translation.
- ///
- ///
- /// The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the original text to translate. For example, `en` for English, `zh` for Chinese, `fr` for French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish is `es-MX`. See the [list of supported languages and language codes](https://dev.writer.com/api-reference/translation-api/language-support).
- ///
- ///
- /// The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the target language for the translation. For example, `en` for English, `zh` for Chinese, `fr` for French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish is `es-MX`. See the [list of supported languages and language codes](https://dev.writer.com/api-reference/translation-api/language-support).
- ///
- ///
- /// The text to translate. Maximum of 100,000 words.
- ///
- ///
- /// Whether to use formal or informal language in the translation. See the [list of languages that support formality](https://dev.writer.com/api-reference/translation-api/language-support#formality). If the language does not support formality, this parameter is ignored.
- ///
- ///
- /// Whether to control the length of the translated text. See the [list of languages that support length control](https://dev.writer.com/api-reference/translation-api/language-support#length-control). If the language does not support length control, this parameter is ignored.
- ///
- ///
- /// Whether to mask profane words in the translated text. See the [list of languages that do not support profanity masking](https://dev.writer.com/api-reference/translation-api/language-support#profanity-masking). If the language does not support profanity masking, this parameter is ignored.
- ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
- /// The token to cancel the operation with
- ///
- public async global::System.Threading.Tasks.Task CreateTranslationAsync(
- string sourceLanguageCode,
- string targetLanguageCode,
- string text,
- bool formality,
- bool lengthControl,
- bool maskProfanity,
- global::Writer.TranslationRequestModel model = default,
- global::Writer.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __request = new global::Writer.TranslationRequest
- {
- Model = model,
- SourceLanguageCode = sourceLanguageCode,
- TargetLanguageCode = targetLanguageCode,
- Text = text,
- Formality = formality,
- LengthControl = lengthControl,
- MaskProfanity = maskProfanity,
- };
-
- return await CreateTranslationAsync(
- request: __request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/Writer/Generated/Writer.TranslationClient.g.cs b/src/libs/Writer/Generated/Writer.TranslationClient.g.cs
deleted file mode 100644
index c3e0ec8..0000000
--- a/src/libs/Writer/Generated/Writer.TranslationClient.g.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-
-#nullable enable
-
-namespace Writer
-{
- ///
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
- ///
- public sealed partial class TranslationClient : global::Writer.ITranslationClient, global::System.IDisposable
- {
- ///
- ///
- ///
- public const string DefaultBaseUrl = "https://api.writer.com/";
-
- private bool _disposeHttpClient = true;
-
- ///
- public global::System.Net.Http.HttpClient HttpClient { get; }
-
- ///
- public System.Uri? BaseUri => HttpClient.BaseAddress;
-
- ///
- public global::System.Collections.Generic.List Authorizations { get; }
-
- ///
- public bool ReadResponseAsString { get; set; }
-#if DEBUG
- = true;
-#endif
-
- ///
- public global::Writer.AutoSDKClientOptions Options { get; }
- ///
- ///
- ///
- public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Writer.SourceGenerationContext.Default;
-
-
- ///
- /// Creates a new instance of the TranslationClient.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
- ///
- /// The HttpClient instance. If not provided, a new one will be created.
- /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
- /// The authorizations to use for the requests.
- /// Dispose the HttpClient when the instance is disposed. True by default.
- public TranslationClient(
- global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null,
- global::System.Collections.Generic.List? authorizations = null,
- bool disposeHttpClient = true) : this(
- httpClient,
- baseUri,
- authorizations,
- options: null,
- disposeHttpClient: disposeHttpClient)
- {
- }
-
- ///
- /// Creates a new instance of the TranslationClient with explicit options but no base URL override.
- /// Skips passing baseUri so the default base URL from the OpenAPI spec applies.
- ///
- /// The HttpClient instance. If not provided, a new one will be created.
- /// The authorizations to use for the requests.
- /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
- /// Dispose the HttpClient when the instance is disposed. True by default.
- public TranslationClient(
- global::System.Net.Http.HttpClient? httpClient,
- global::System.Collections.Generic.List? authorizations,
- global::Writer.AutoSDKClientOptions? options,
- bool disposeHttpClient = true) : this(
- httpClient,
- baseUri: null,
- authorizations,
- options,
- disposeHttpClient: disposeHttpClient)
- {
- }
-
- ///
- /// Creates a new instance of the TranslationClient.
- /// If no httpClient is provided, a new one will be created.
- /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
- ///
- /// The HttpClient instance. If not provided, a new one will be created.
- /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
- /// The authorizations to use for the requests.
- /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
- /// Dispose the HttpClient when the instance is disposed. True by default.
- public TranslationClient(
- global::System.Net.Http.HttpClient? httpClient,
- global::System.Uri? baseUri,
- global::System.Collections.Generic.List? authorizations,
- global::Writer.AutoSDKClientOptions? options,
- bool disposeHttpClient = true)
- {
-
- HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
- HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl);
- Authorizations = authorizations ?? new global::System.Collections.Generic.List();
- Options = options ?? new global::Writer.AutoSDKClientOptions();
- _disposeHttpClient = disposeHttpClient;
-
- Initialized(HttpClient);
- }
-
- ///
- public void Dispose()
- {
- if (_disposeHttpClient)
- {
- HttpClient.Dispose();
- }
- }
-
- partial void Initialized(
- global::System.Net.Http.HttpClient client);
- partial void PrepareArguments(
- global::System.Net.Http.HttpClient client);
- partial void PrepareRequest(
- global::System.Net.Http.HttpClient client,
- global::System.Net.Http.HttpRequestMessage request);
- partial void ProcessResponse(
- global::System.Net.Http.HttpClient client,
- global::System.Net.Http.HttpResponseMessage response);
- partial void ProcessResponseContent(
- global::System.Net.Http.HttpClient client,
- global::System.Net.Http.HttpResponseMessage response,
- ref string content);
- }
-}
\ No newline at end of file
diff --git a/src/libs/Writer/Generated/Writer.WriterClient.g.cs b/src/libs/Writer/Generated/Writer.WriterClient.g.cs
index 175137b..51506ee 100644
--- a/src/libs/Writer/Generated/Writer.WriterClient.g.cs
+++ b/src/libs/Writer/Generated/Writer.WriterClient.g.cs
@@ -84,15 +84,6 @@ public sealed partial class WriterClient : global::Writer.IWriterClient, global:
JsonSerializerContext = JsonSerializerContext,
};
- ///
- ///
- ///
- public TranslationClient Translation => new TranslationClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options)
- {
- ReadResponseAsString = ReadResponseAsString,
- JsonSerializerContext = JsonSerializerContext,
- };
-
///
///
///
diff --git a/src/libs/Writer/Generated/autosdk.generated-examples.json b/src/libs/Writer/Generated/autosdk.generated-examples.json
index 10bcb31..2a4e887 100644
--- a/src/libs/Writer/Generated/autosdk.generated-examples.json
+++ b/src/libs/Writer/Generated/autosdk.generated-examples.json
@@ -134,17 +134,6 @@
},
{
"Order": 13,
- "Title": "Translate text",
- "Slug": "translate-text",
- "Description": "Translate text from one language to another.",
- "Language": "csharp",
- "Code": "using var client = new WriterClient(apiKey);\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::Writer.TranslationRequest\u003E(\n @\u0022{\n \u0022\u0022model\u0022\u0022: \u0022\u0022palmyra-translate\u0022\u0022,\n \u0022\u0022source_language_code\u0022\u0022: \u0022\u0022en\u0022\u0022,\n \u0022\u0022target_language_code\u0022\u0022: \u0022\u0022es\u0022\u0022,\n \u0022\u0022text\u0022\u0022: \u0022\u0022Hello, world!\u0022\u0022,\n \u0022\u0022formality\u0022\u0022: true,\n \u0022\u0022length_control\u0022\u0022: true,\n \u0022\u0022mask_profanity\u0022\u0022: true\n}\u0022)!;\n\nvar response = await client.Translation.CreateTranslationAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022data\u0022: \u0022\\u00A1Hola, mundo!\u0022\n// }",
- "Format": "sdk",
- "OperationId": "createTranslation",
- "Setup": "This example assumes \u0060using Writer;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential."
- },
- {
- "Order": 14,
"Title": "Analyze images",
"Slug": "analyze-images",
"Description": "Submit images and documents with a prompt to generate an analysis. Supports JPG, PNG, PDF, and TXT files up to 7MB each.",
diff --git a/src/libs/Writer/openapi.yaml b/src/libs/Writer/openapi.yaml
index 9e3ea6c..a92044c 100644
--- a/src/libs/Writer/openapi.yaml
+++ b/src/libs/Writer/openapi.yaml
@@ -2098,86 +2098,6 @@ paths:
}],
)
print(vision_response.data)
- /v1/translation:
- post:
- tags:
- - Translation
- summary: Translate text
- description: Translate text from one language to another.
- security:
- - bearerAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/translation_request'
- example:
- model: palmyra-translate
- source_language_code: en
- target_language_code: es
- text: Hello, world!
- formality: true
- length_control: true
- mask_profanity: true
- responses:
- '200':
- description: Successful response
- content:
- application/json:
- example:
- data: ¡Hola, mundo!
- schema:
- $ref: '#/components/schemas/translation_response'
- x-codeSamples:
- - lang: cURL
- source: >-
- curl --location --request POST https://api.writer.com/v1/translation \
- --header "Authorization: Bearer " \
- --header "Content-Type: application/json" \
- --data-raw
- '{"model":"string","source_language_code":"string","target_language_code":"string","text":"string","formality":false,"length_control":false,"mask_profanity":false}'
- - lang: JavaScript
- source: |-
- import Writer from 'writer-sdk';
-
- const client = new Writer({
- apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted
- });
-
- async function main() {
- const translationResponse = await client.translation.translate({
- formality: true,
- length_control: true,
- mask_profanity: true,
- model: 'palmyra-translate',
- source_language_code: 'en',
- target_language_code: 'es',
- text: 'Hello, world!',
- });
-
- console.log(translationResponse.data);
- }
-
- main();
- - lang: Python
- source: |-
- import os
- from writerai import Writer
-
- client = Writer(
- api_key=os.environ.get("WRITER_API_KEY"), # This is the default and can be omitted
- )
- translation_response = client.translation.translate(
- formality=True,
- length_control=True,
- mask_profanity=True,
- model="palmyra-translate",
- source_language_code="en",
- target_language_code="es",
- text="Hello, world!",
- )
- print(translation_response.data)
components:
securitySchemes:
bearerAuth:
@@ -4250,74 +4170,6 @@ components:
data:
type: string
description: The result of the image analysis.
- translation_request:
- title: Translation Request
- required:
- - model
- - source_language_code
- - target_language_code
- - text
- - formality
- - length_control
- - mask_profanity
- type: object
- properties:
- model:
- type: string
- description: The model to use for translation.
- enum:
- - palmyra-translate
- source_language_code:
- type: string
- description: >-
- The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the
- original text to translate. For example, `en` for English, `zh` for Chinese, `fr` for French, `es`
- for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country
- code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish
- is `es-MX`. See the [list of supported languages and language
- codes](https://dev.writer.com/api-reference/translation-api/language-support).
- target_language_code:
- type: string
- description: >-
- The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the
- target language for the translation. For example, `en` for English, `zh` for Chinese, `fr` for
- French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166
- country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican
- Spanish is `es-MX`. See the [list of supported languages and language
- codes](https://dev.writer.com/api-reference/translation-api/language-support).
- text:
- type: string
- description: The text to translate. Maximum of 100,000 words.
- formality:
- type: boolean
- description: >-
- Whether to use formal or informal language in the translation. See the [list of languages that
- support
- formality](https://dev.writer.com/api-reference/translation-api/language-support#formality). If
- the language does not support formality, this parameter is ignored.
- length_control:
- type: boolean
- description: >-
- Whether to control the length of the translated text. See the [list of languages that support
- length
- control](https://dev.writer.com/api-reference/translation-api/language-support#length-control). If
- the language does not support length control, this parameter is ignored.
- mask_profanity:
- type: boolean
- description: >-
- Whether to mask profane words in the translated text. See the [list of languages that do not
- support profanity
- masking](https://dev.writer.com/api-reference/translation-api/language-support#profanity-masking).
- If the language does not support profanity masking, this parameter is ignored.
- translation_response:
- title: Translation Response
- required:
- - data
- type: object
- properties:
- data:
- type: string
- description: The result of the translation.
translation_tool:
title: Translation tool
description: >-