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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,18 @@ public partial interface ITextToSpeechClient
/// Accepts the same language codes as `language` (including `auto`,<br/>
/// `nl`, `sv`).
/// </param>
/// <param name="dateFormat">
/// Optional. Controls how all-numeric dates (e.g. `05/03/2024`) are<br/>
/// read out, independent of the synthesis voice:<br/>
/// - `EU` — day/month order (`DD/MM`): `05/03/2024` → "fifth March,<br/>
/// twenty twenty four".<br/>
/// - `US` — month/day order (`MM/DD`): `05/03/2024` → "May third,<br/>
/// twenty twenty four".<br/>
/// Omit this field to keep the existing behaviour: English dates<br/>
/// default to `US` (`MM/DD`). Applies across all languages, so you can<br/>
/// force day-first (`DD/MM`) reading — e.g. the Indian convention — on<br/>
/// any voice.
/// </param>
/// <param name="mathNotation">
/// Opt-in flag that reads digit-flanked math operators (`5 x 3`,<br/>
/// `2 ^ 10`, `6 ÷ 2`) as words instead of leaving them for the<br/>
Expand Down Expand Up @@ -535,6 +547,7 @@ public partial interface ITextToSpeechClient
double? speed = default,
global::SmallestAI.TtsRequestLanguage? language = default,
global::SmallestAI.TtsRequestNumberPronunciationLanguage? numberPronunciationLanguage = default,
global::SmallestAI.TtsRequestDateFormat? dateFormat = default,
bool? mathNotation = default,
global::SmallestAI.TtsRequestContentFilter? contentFilter = default,
global::SmallestAI.TtsRequestOutputFormat? outputFormat = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,18 @@ public partial interface ITextToSpeechClient
/// Accepts the same language codes as `language` (including `auto`,<br/>
/// `nl`, `sv`).
/// </param>
/// <param name="dateFormat">
/// Optional. Controls how all-numeric dates (e.g. `05/03/2024`) are<br/>
/// read out, independent of the synthesis voice:<br/>
/// - `EU` — day/month order (`DD/MM`): `05/03/2024` → "fifth March,<br/>
/// twenty twenty four".<br/>
/// - `US` — month/day order (`MM/DD`): `05/03/2024` → "May third,<br/>
/// twenty twenty four".<br/>
/// Omit this field to keep the existing behaviour: English dates<br/>
/// default to `US` (`MM/DD`). Applies across all languages, so you can<br/>
/// force day-first (`DD/MM`) reading — e.g. the Indian convention — on<br/>
/// any voice.
/// </param>
/// <param name="mathNotation">
/// Opt-in flag that reads digit-flanked math operators (`5 x 3`,<br/>
/// `2 ^ 10`, `6 ÷ 2`) as words instead of leaving them for the<br/>
Expand Down Expand Up @@ -237,6 +249,7 @@ public partial interface ITextToSpeechClient
double? speed = default,
global::SmallestAI.TtsRequestLanguage? language = default,
global::SmallestAI.TtsRequestNumberPronunciationLanguage? numberPronunciationLanguage = default,
global::SmallestAI.TtsRequestDateFormat? dateFormat = default,
bool? mathNotation = default,
global::SmallestAI.TtsRequestContentFilter? contentFilter = default,
global::SmallestAI.TtsRequestOutputFormat? outputFormat = default,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace SmallestAI.JsonConverters
{
/// <inheritdoc />
public sealed class TtsRequestDateFormatJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::SmallestAI.TtsRequestDateFormat>
{
/// <inheritdoc />
public override global::SmallestAI.TtsRequestDateFormat 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::SmallestAI.TtsRequestDateFormatExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::SmallestAI.TtsRequestDateFormat)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::SmallestAI.TtsRequestDateFormat);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::SmallestAI.TtsRequestDateFormat value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::SmallestAI.TtsRequestDateFormatExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace SmallestAI.JsonConverters
{
/// <inheritdoc />
public sealed class TtsRequestDateFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::SmallestAI.TtsRequestDateFormat?>
{
/// <inheritdoc />
public override global::SmallestAI.TtsRequestDateFormat? 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::SmallestAI.TtsRequestDateFormatExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::SmallestAI.TtsRequestDateFormat)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::SmallestAI.TtsRequestDateFormat?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::SmallestAI.TtsRequestDateFormat? 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::SmallestAI.TtsRequestDateFormatExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ namespace SmallestAI

typeof(global::SmallestAI.JsonConverters.TtsRequestNumberPronunciationLanguageNullableJsonConverter),

typeof(global::SmallestAI.JsonConverters.TtsRequestDateFormatJsonConverter),

typeof(global::SmallestAI.JsonConverters.TtsRequestDateFormatNullableJsonConverter),

typeof(global::SmallestAI.JsonConverters.TtsRequestContentFilterActionJsonConverter),

typeof(global::SmallestAI.JsonConverters.TtsRequestContentFilterActionNullableJsonConverter),
Expand Down Expand Up @@ -186,6 +190,7 @@ namespace SmallestAI
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestSampleRate), TypeInfoPropertyName = "TtsRequestSampleRate2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestLanguage), TypeInfoPropertyName = "TtsRequestLanguage2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestNumberPronunciationLanguage), TypeInfoPropertyName = "TtsRequestNumberPronunciationLanguage2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestDateFormat), TypeInfoPropertyName = "TtsRequestDateFormat2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestContentFilterAction), TypeInfoPropertyName = "TtsRequestContentFilterAction2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestContentFilter))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))]
Expand Down
Loading
Loading