From 941809977101346e15094df3c1c9af7f0bc9cb07 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 13 Sep 2026 15:35:22 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...lestAI.Electron.JsonSerializerContext.g.cs | 277 +++++++++++++++++ ....ElectronClient.Authorizations.Bearer.g.cs | 35 +++ ...AI.ElectronClient.Constructors.Bearer.g.cs | 31 ++ .../Generated/SmallestAI.ElectronClient.g.cs | 2 +- ...IElectronClient.Authorizations.Bearer.g.cs | 16 + ...tionariesClient.Authorizations.Bearer.g.cs | 16 + ...echToTextClient.Authorizations.Bearer.g.cs | 16 + ...tToSpeechClient.Authorizations.Bearer.g.cs | 16 + ...ceCloningClient.Authorizations.Bearer.g.cs | 16 + ...I.IVoicesClient.Authorizations.Bearer.g.cs | 16 + ...ionDictionaries.JsonSerializerContext.g.cs | 145 +++++++++ ...tionariesClient.Authorizations.Bearer.g.cs | 35 +++ ...ictionariesClient.Constructors.Bearer.g.cs | 31 ++ ...estAI.PronunciationDictionariesClient.g.cs | 2 +- ...AI.SpeechToText.JsonSerializerContext.g.cs | 294 ++++++++++++++++++ ...echToTextClient.Authorizations.Bearer.g.cs | 35 +++ ...peechToTextClient.Constructors.Bearer.g.cs | 31 ++ .../SmallestAI.SpeechToTextClient.g.cs | 2 +- ...AI.TextToSpeech.JsonSerializerContext.g.cs | 278 +++++++++++++++++ ...tToSpeechClient.Authorizations.Bearer.g.cs | 35 +++ ...extToSpeechClient.Constructors.Bearer.g.cs | 31 ++ .../SmallestAI.TextToSpeechClient.g.cs | 2 +- ...AI.VoiceCloning.JsonSerializerContext.g.cs | 256 +++++++++++++++ ...ceCloningClient.Authorizations.Bearer.g.cs | 35 +++ ...oiceCloningClient.Constructors.Bearer.g.cs | 31 ++ .../SmallestAI.VoiceCloningClient.g.cs | 2 +- ...allestAI.Voices.JsonSerializerContext.g.cs | 167 ++++++++++ ...AI.VoicesClient.Authorizations.Bearer.g.cs | 35 +++ ...stAI.VoicesClient.Constructors.Bearer.g.cs | 31 ++ .../Generated/SmallestAI.VoicesClient.g.cs | 2 +- 30 files changed, 1915 insertions(+), 6 deletions(-) create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.Electron.JsonSerializerContext.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.Constructors.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.IElectronClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.IPronunciationDictionariesClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.ISpeechToTextClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.ITextToSpeechClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.IVoiceCloningClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.IVoicesClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionaries.JsonSerializerContext.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.Constructors.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.SpeechToText.JsonSerializerContext.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.Constructors.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.TextToSpeech.JsonSerializerContext.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.Constructors.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.VoiceCloning.JsonSerializerContext.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.Constructors.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.Voices.JsonSerializerContext.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.Authorizations.Bearer.g.cs create mode 100644 src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.Constructors.Bearer.g.cs diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Electron.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Electron.JsonSerializerContext.g.cs new file mode 100644 index 0000000..26186fc --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Electron.JsonSerializerContext.g.cs @@ -0,0 +1,277 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace SmallestAI +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCallType), TypeInfoPropertyName = "ElectronToolCallType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCallFunction))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCall))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronMessage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestStreamOptions))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestToolChoice0), TypeInfoPropertyName = "ChatCompletionRequestToolChoice02")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Type), TypeInfoPropertyName = "ChatCompletionRequestToolChoiceOneOf1Type2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Function))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestToolChoice1))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestToolChoice), TypeInfoPropertyName = "ChatCompletionRequestToolChoice2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestResponseFormatType), TypeInfoPropertyName = "ChatCompletionRequestResponseFormatType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestResponseFormat))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestStop), TypeInfoPropertyName = "ChatCompletionRequestStop2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequest))] + [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(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionObject), TypeInfoPropertyName = "ChatCompletionObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionChoicesItemsFinishReason), TypeInfoPropertyName = "ChatCompletionChoicesItemsFinishReason2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionChoicesItems))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.UsagePromptTokensDetails))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.Usage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletion))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ErrorErrorDetailsItems))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ErrorError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.Error))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCallType?), TypeInfoPropertyName = "NullableElectronToolCallType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestToolChoice0?), TypeInfoPropertyName = "NullableChatCompletionRequestToolChoice02")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Type?), TypeInfoPropertyName = "NullableChatCompletionRequestToolChoiceOneOf1Type2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestToolChoice?), TypeInfoPropertyName = "NullableChatCompletionRequestToolChoice2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestResponseFormatType?), TypeInfoPropertyName = "NullableChatCompletionRequestResponseFormatType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestStop?), TypeInfoPropertyName = "NullableChatCompletionRequestStop2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionObject?), TypeInfoPropertyName = "NullableChatCompletionObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionChoicesItemsFinishReason?), TypeInfoPropertyName = "NullableChatCompletionChoicesItemsFinishReason2")] + [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))] + internal sealed partial class ElectronSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ElectronSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ElectronSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ElectronSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::SmallestAI.JsonConverters.ChatCompletionRequestToolChoiceJsonConverter()); + options.Converters.Add(new global::SmallestAI.JsonConverters.ChatCompletionRequestStopJsonConverter()); + options.Converters.Add(new global::SmallestAI.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::SmallestAI.ElectronToolCallType) + + || typeToConvert == typeof(global::SmallestAI.ElectronToolCallType?) + + || typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestToolChoice0) + + || typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestToolChoice0?) + + || typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Type) + + || typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Type?) + + || typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestResponseFormatType) + + || typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestResponseFormatType?) + + || typeToConvert == typeof(global::SmallestAI.ChatCompletionObject) + + || typeToConvert == typeof(global::SmallestAI.ChatCompletionObject?) + + || typeToConvert == typeof(global::SmallestAI.ChatCompletionChoicesItemsFinishReason) + + || typeToConvert == typeof(global::SmallestAI.ChatCompletionChoicesItemsFinishReason?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::SmallestAI.ElectronToolCallType)) + { + return new global::SmallestAI.JsonConverters.ElectronToolCallTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ElectronToolCallType?)) + { + return new global::SmallestAI.JsonConverters.ElectronToolCallTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestToolChoice0)) + { + return new global::SmallestAI.JsonConverters.ChatCompletionRequestToolChoice0JsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestToolChoice0?)) + { + return new global::SmallestAI.JsonConverters.ChatCompletionRequestToolChoice0NullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Type)) + { + return new global::SmallestAI.JsonConverters.ChatCompletionRequestToolChoiceOneOf1TypeJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Type?)) + { + return new global::SmallestAI.JsonConverters.ChatCompletionRequestToolChoiceOneOf1TypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestResponseFormatType)) + { + return new global::SmallestAI.JsonConverters.ChatCompletionRequestResponseFormatTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ChatCompletionRequestResponseFormatType?)) + { + return new global::SmallestAI.JsonConverters.ChatCompletionRequestResponseFormatTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ChatCompletionObject)) + { + return new global::SmallestAI.JsonConverters.ChatCompletionObjectJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ChatCompletionObject?)) + { + return new global::SmallestAI.JsonConverters.ChatCompletionObjectNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ChatCompletionChoicesItemsFinishReason)) + { + return new global::SmallestAI.JsonConverters.ChatCompletionChoicesItemsFinishReasonJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ChatCompletionChoicesItemsFinishReason?)) + { + return new global::SmallestAI.JsonConverters.ChatCompletionChoicesItemsFinishReasonNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new ElectronSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..4c4e63d --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class ElectronClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::SmallestAI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.Constructors.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..94491ea --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class ElectronClient + { + /// + + public ElectronClient( + string apiKey, + 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, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.g.cs index eb00d63..0bb56d7 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.ElectronClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class ElectronClient : global::SmallestAI.IElectronClient, /// public global::SmallestAI.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.ElectronSourceGenerationContext.Default); /// /// diff --git a/src/libs/SmallestAI/Generated/SmallestAI.IElectronClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.IElectronClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..2a1e670 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.IElectronClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace SmallestAI +{ + public partial interface IElectronClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.IPronunciationDictionariesClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.IPronunciationDictionariesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..cab014d --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.IPronunciationDictionariesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace SmallestAI +{ + public partial interface IPronunciationDictionariesClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.ISpeechToTextClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.ISpeechToTextClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..18633aa --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.ISpeechToTextClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace SmallestAI +{ + public partial interface ISpeechToTextClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.ITextToSpeechClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.ITextToSpeechClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..a5ceb4c --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.ITextToSpeechClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace SmallestAI +{ + public partial interface ITextToSpeechClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.IVoiceCloningClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.IVoiceCloningClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..96c7731 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.IVoiceCloningClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace SmallestAI +{ + public partial interface IVoiceCloningClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.IVoicesClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.IVoicesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..3300a65 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.IVoicesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace SmallestAI +{ + public partial interface IVoicesClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionaries.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionaries.JsonSerializerContext.g.cs new file mode 100644 index 0000000..546eda5 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionaries.JsonSerializerContext.g.cs @@ -0,0 +1,145 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace SmallestAI +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.PronunciationItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.PronunciationDict))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ErrorResponseDetailsItems))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.CreatePronunciationDictRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.UpdatePronunciationDictRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.UpdatePronunciationDictResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.DeletePronunciationDictRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.DeletePronunciationDictResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [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))] + internal sealed partial class PronunciationDictionariesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class PronunciationDictionariesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static PronunciationDictionariesSourceGenerationContext Default { get; } = new(DefaultOptions); + + private PronunciationDictionariesSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::SmallestAI.JsonConverters.UnixTimestampJsonConverter()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new PronunciationDictionariesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..f7dfbef --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class PronunciationDictionariesClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::SmallestAI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.Constructors.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..53eb803 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class PronunciationDictionariesClient + { + /// + + public PronunciationDictionariesClient( + string apiKey, + 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, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.g.cs index 8f78d6e..4fdece6 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionariesClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class PronunciationDictionariesClient : global::SmallestAI /// public global::SmallestAI.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.PronunciationDictionariesSourceGenerationContext.Default); /// /// diff --git a/src/libs/SmallestAI/Generated/SmallestAI.SpeechToText.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.SpeechToText.JsonSerializerContext.g.cs new file mode 100644 index 0000000..ee83ab1 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.SpeechToText.JsonSerializerContext.g.cs @@ -0,0 +1,294 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace SmallestAI +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersModel), TypeInfoPropertyName = "WavesV1SttPostParametersModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersLanguage), TypeInfoPropertyName = "WavesV1SttPostParametersLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersWebhookMethod), TypeInfoPropertyName = "WavesV1SttPostParametersWebhookMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersRedactPii), TypeInfoPropertyName = "WavesV1SttPostParametersRedactPii2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersRedactPci), TypeInfoPropertyName = "WavesV1SttPostParametersRedactPci2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersEmotionDetection), TypeInfoPropertyName = "WavesV1SttPostParametersEmotionDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersGenderDetection), TypeInfoPropertyName = "WavesV1SttPostParametersGenderDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersXExpireContent), TypeInfoPropertyName = "WavesV1SttPostParametersXExpireContent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.Word))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.Utterance))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TranscriptionResponseMetadata))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TranscriptionResponse))] + [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::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.AsyncAccepted))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.SpeechToTextTranscribeResponse200), TypeInfoPropertyName = "SpeechToTextTranscribeResponse2002")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.SttErrorResponseDetailsItems))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.SttErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TranscriptionUrlRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersModel?), TypeInfoPropertyName = "NullableWavesV1SttPostParametersModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersLanguage?), TypeInfoPropertyName = "NullableWavesV1SttPostParametersLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersWebhookMethod?), TypeInfoPropertyName = "NullableWavesV1SttPostParametersWebhookMethod2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersRedactPii?), TypeInfoPropertyName = "NullableWavesV1SttPostParametersRedactPii2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersRedactPci?), TypeInfoPropertyName = "NullableWavesV1SttPostParametersRedactPci2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersEmotionDetection?), TypeInfoPropertyName = "NullableWavesV1SttPostParametersEmotionDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersGenderDetection?), TypeInfoPropertyName = "NullableWavesV1SttPostParametersGenderDetection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1SttPostParametersXExpireContent?), TypeInfoPropertyName = "NullableWavesV1SttPostParametersXExpireContent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.SpeechToTextTranscribeResponse200?), TypeInfoPropertyName = "NullableSpeechToTextTranscribeResponse2002")] + [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))] + internal sealed partial class SpeechToTextSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class SpeechToTextSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static SpeechToTextSourceGenerationContext Default { get; } = new(DefaultOptions); + + private SpeechToTextSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::SmallestAI.JsonConverters.SpeechToTextTranscribeResponse200JsonConverter()); + options.Converters.Add(new global::SmallestAI.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersModel) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersModel?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersLanguage) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersLanguage?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersWebhookMethod) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersWebhookMethod?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersRedactPii) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersRedactPii?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersRedactPci) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersRedactPci?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersEmotionDetection) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersEmotionDetection?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersGenderDetection) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersGenderDetection?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersXExpireContent) + + || typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersXExpireContent?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersModel)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersModelJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersModel?)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersModelNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersLanguage)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersLanguageJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersLanguage?)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersLanguageNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersWebhookMethod)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersWebhookMethodJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersWebhookMethod?)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersWebhookMethodNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersRedactPii)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersRedactPiiJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersRedactPii?)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersRedactPiiNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersRedactPci)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersRedactPciJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersRedactPci?)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersRedactPciNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersEmotionDetection)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersEmotionDetectionJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersEmotionDetection?)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersEmotionDetectionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersGenderDetection)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersGenderDetectionJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersGenderDetection?)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersGenderDetectionNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersXExpireContent)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersXExpireContentJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1SttPostParametersXExpireContent?)) + { + return new global::SmallestAI.JsonConverters.WavesV1SttPostParametersXExpireContentNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new SpeechToTextSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..b013fda --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class SpeechToTextClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::SmallestAI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.Constructors.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..5d96907 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class SpeechToTextClient + { + /// + + public SpeechToTextClient( + string apiKey, + 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, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.g.cs index 05765f2..6de3bd8 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.SpeechToTextClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class SpeechToTextClient : global::SmallestAI.ISpeechToTex /// public global::SmallestAI.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.SpeechToTextSourceGenerationContext.Default); /// /// diff --git a/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeech.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeech.JsonSerializerContext.g.cs new file mode 100644 index 0000000..faa5f35 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeech.JsonSerializerContext.g.cs @@ -0,0 +1,278 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace SmallestAI +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1TtsPostParametersAccept), TypeInfoPropertyName = "WavesV1TtsPostParametersAccept2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1TtsPostParametersXExpireContent), TypeInfoPropertyName = "WavesV1TtsPostParametersXExpireContent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestModel), TypeInfoPropertyName = "TtsRequestModel2")] + [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.TtsRequestOutputFormat), TypeInfoPropertyName = "TtsRequestOutputFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1TtsLivePostParametersXExpireContent), TypeInfoPropertyName = "WavesV1TtsLivePostParametersXExpireContent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1TtsPostParametersAccept?), TypeInfoPropertyName = "NullableWavesV1TtsPostParametersAccept2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1TtsPostParametersXExpireContent?), TypeInfoPropertyName = "NullableWavesV1TtsPostParametersXExpireContent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestModel?), TypeInfoPropertyName = "NullableTtsRequestModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestSampleRate?), TypeInfoPropertyName = "NullableTtsRequestSampleRate2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestLanguage?), TypeInfoPropertyName = "NullableTtsRequestLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestNumberPronunciationLanguage?), TypeInfoPropertyName = "NullableTtsRequestNumberPronunciationLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.TtsRequestOutputFormat?), TypeInfoPropertyName = "NullableTtsRequestOutputFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1TtsLivePostParametersXExpireContent?), TypeInfoPropertyName = "NullableWavesV1TtsLivePostParametersXExpireContent2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class TextToSpeechSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class TextToSpeechSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static TextToSpeechSourceGenerationContext Default { get; } = new(DefaultOptions); + + private TextToSpeechSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::SmallestAI.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::SmallestAI.WavesV1TtsPostParametersAccept) + + || typeToConvert == typeof(global::SmallestAI.WavesV1TtsPostParametersAccept?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1TtsPostParametersXExpireContent) + + || typeToConvert == typeof(global::SmallestAI.WavesV1TtsPostParametersXExpireContent?) + + || typeToConvert == typeof(global::SmallestAI.TtsRequestModel) + + || typeToConvert == typeof(global::SmallestAI.TtsRequestModel?) + + || typeToConvert == typeof(global::SmallestAI.TtsRequestSampleRate) + + || typeToConvert == typeof(global::SmallestAI.TtsRequestSampleRate?) + + || typeToConvert == typeof(global::SmallestAI.TtsRequestLanguage) + + || typeToConvert == typeof(global::SmallestAI.TtsRequestLanguage?) + + || typeToConvert == typeof(global::SmallestAI.TtsRequestNumberPronunciationLanguage) + + || typeToConvert == typeof(global::SmallestAI.TtsRequestNumberPronunciationLanguage?) + + || typeToConvert == typeof(global::SmallestAI.TtsRequestOutputFormat) + + || typeToConvert == typeof(global::SmallestAI.TtsRequestOutputFormat?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1TtsLivePostParametersXExpireContent) + + || typeToConvert == typeof(global::SmallestAI.WavesV1TtsLivePostParametersXExpireContent?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::SmallestAI.WavesV1TtsPostParametersAccept)) + { + return new global::SmallestAI.JsonConverters.WavesV1TtsPostParametersAcceptJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1TtsPostParametersAccept?)) + { + return new global::SmallestAI.JsonConverters.WavesV1TtsPostParametersAcceptNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1TtsPostParametersXExpireContent)) + { + return new global::SmallestAI.JsonConverters.WavesV1TtsPostParametersXExpireContentJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1TtsPostParametersXExpireContent?)) + { + return new global::SmallestAI.JsonConverters.WavesV1TtsPostParametersXExpireContentNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.TtsRequestModel)) + { + return new global::SmallestAI.JsonConverters.TtsRequestModelJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.TtsRequestModel?)) + { + return new global::SmallestAI.JsonConverters.TtsRequestModelNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.TtsRequestSampleRate)) + { + return new global::SmallestAI.JsonConverters.TtsRequestSampleRateJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.TtsRequestSampleRate?)) + { + return new global::SmallestAI.JsonConverters.TtsRequestSampleRateNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.TtsRequestLanguage)) + { + return new global::SmallestAI.JsonConverters.TtsRequestLanguageJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.TtsRequestLanguage?)) + { + return new global::SmallestAI.JsonConverters.TtsRequestLanguageNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.TtsRequestNumberPronunciationLanguage)) + { + return new global::SmallestAI.JsonConverters.TtsRequestNumberPronunciationLanguageJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.TtsRequestNumberPronunciationLanguage?)) + { + return new global::SmallestAI.JsonConverters.TtsRequestNumberPronunciationLanguageNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.TtsRequestOutputFormat)) + { + return new global::SmallestAI.JsonConverters.TtsRequestOutputFormatJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.TtsRequestOutputFormat?)) + { + return new global::SmallestAI.JsonConverters.TtsRequestOutputFormatNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1TtsLivePostParametersXExpireContent)) + { + return new global::SmallestAI.JsonConverters.WavesV1TtsLivePostParametersXExpireContentJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1TtsLivePostParametersXExpireContent?)) + { + return new global::SmallestAI.JsonConverters.WavesV1TtsLivePostParametersXExpireContentNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new TextToSpeechSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..d3b60f9 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class TextToSpeechClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::SmallestAI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.Constructors.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..69e5ab6 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class TextToSpeechClient + { + /// + + public TextToSpeechClient( + string apiKey, + 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, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.g.cs index 9286def..bbda829 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeechClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class TextToSpeechClient : global::SmallestAI.ITextToSpeec /// public global::SmallestAI.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.TextToSpeechSourceGenerationContext.Default); /// /// diff --git a/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloning.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloning.JsonSerializerContext.g.cs new file mode 100644 index 0000000..03bb6c8 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloning.JsonSerializerContext.g.cs @@ -0,0 +1,256 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace SmallestAI +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguage), TypeInfoPropertyName = "WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModel), TypeInfoPropertyName = "WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatus), TypeInfoPropertyName = "WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataSamplesItems))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.VoiceCloningCreateVoiceCloneResponse200))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.CreateVoiceCloneRequestBadRequestError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.CreateVoiceCloneRequestUnauthorizedError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCode), TypeInfoPropertyName = "WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.CreateVoiceCloneRequestInternalServerError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatus), TypeInfoPropertyName = "WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningType), TypeInfoPropertyName = "WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItems))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.VoiceCloningListVoiceClonesResponse200))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.CreateVoiceCloneRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguage?), TypeInfoPropertyName = "NullableWavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModel?), TypeInfoPropertyName = "NullableWavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatus?), TypeInfoPropertyName = "NullableWavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCode?), TypeInfoPropertyName = "NullableWavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCode2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatus?), TypeInfoPropertyName = "NullableWavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningType?), TypeInfoPropertyName = "NullableWavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningType2")] + [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))] + internal sealed partial class VoiceCloningSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class VoiceCloningSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static VoiceCloningSourceGenerationContext Default { get; } = new(DefaultOptions); + + private VoiceCloningSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::SmallestAI.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguage) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguage?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModel) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModel?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatus) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatus?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCode) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCode?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatus) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatus?) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningType) + + || typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningType?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguage)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguageJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguage?)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguageNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModel)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModelJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModel?)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModelNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatus)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatus?)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatusNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCode)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCodeJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCode?)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCodeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatus)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatus?)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatusNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningType)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningType?)) + { + return new global::SmallestAI.JsonConverters.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningTypeNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new VoiceCloningSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..73ce91f --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class VoiceCloningClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::SmallestAI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.Constructors.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..dd90ea0 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class VoiceCloningClient + { + /// + + public VoiceCloningClient( + string apiKey, + 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, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.g.cs index 95afb0f..e832a18 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloningClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class VoiceCloningClient : global::SmallestAI.IVoiceClonin /// public global::SmallestAI.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.VoiceCloningSourceGenerationContext.Default); /// /// diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Voices.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Voices.JsonSerializerContext.g.cs new file mode 100644 index 0000000..872bfd1 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Voices.JsonSerializerContext.g.cs @@ -0,0 +1,167 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace SmallestAI +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1ModelGetVoicesGetParametersModel), TypeInfoPropertyName = "WavesV1ModelGetVoicesGetParametersModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1ModelGetVoicesGetResponsesContentApplicationJsonSchemaVoicesItemsTags))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1ModelGetVoicesGetResponsesContentApplicationJsonSchemaVoicesItems))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.VoicesGetWavesVoicesResponse200))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.GetWavesVoicesRequestBadRequestError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.GetWavesVoicesRequestUnauthorizedError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.GetWavesVoicesRequestInternalServerError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1ModelGetVoicesGetParametersModel?), TypeInfoPropertyName = "NullableWavesV1ModelGetVoicesGetParametersModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class VoicesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class VoicesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static VoicesSourceGenerationContext Default { get; } = new(DefaultOptions); + + private VoicesSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::SmallestAI.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::SmallestAI.WavesV1ModelGetVoicesGetParametersModel) + + || typeToConvert == typeof(global::SmallestAI.WavesV1ModelGetVoicesGetParametersModel?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::SmallestAI.WavesV1ModelGetVoicesGetParametersModel)) + { + return new global::SmallestAI.JsonConverters.WavesV1ModelGetVoicesGetParametersModelJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.WavesV1ModelGetVoicesGetParametersModel?)) + { + return new global::SmallestAI.JsonConverters.WavesV1ModelGetVoicesGetParametersModelNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new VoicesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..024b42b --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class VoicesClient + { + + /// + public void AuthorizeUsingBearer( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::SmallestAI.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.Constructors.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..458b8be --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class VoicesClient + { + /// + + public VoicesClient( + string apiKey, + 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, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingBearer(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.g.cs index 341277f..d665df3 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.VoicesClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class VoicesClient : global::SmallestAI.IVoicesClient, glo /// public global::SmallestAI.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.VoicesSourceGenerationContext.Default); /// ///