diff --git a/src/libs/Inworld/Generated/Inworld.IModelsClient.Authorizations.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.IModelsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..28964cc --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.IModelsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Inworld +{ + public partial interface IModelsClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Inworld/Generated/Inworld.ISpeechToTextClient.Authorizations.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.ISpeechToTextClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..7ddc045 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.ISpeechToTextClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Inworld +{ + public partial interface ISpeechToTextClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Inworld/Generated/Inworld.ITextToSpeechClient.Authorizations.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.ITextToSpeechClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..a4db3d7 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.ITextToSpeechClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Inworld +{ + public partial interface ITextToSpeechClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Inworld/Generated/Inworld.IVoicesClient.Authorizations.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.IVoicesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..96e7122 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.IVoicesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace Inworld +{ + public partial interface IVoicesClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/Inworld/Generated/Inworld.Models.JsonSerializerContext.g.cs b/src/libs/Inworld/Generated/Inworld.Models.JsonSerializerContext.g.cs new file mode 100644 index 0000000..e750182 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.Models.JsonSerializerContext.g.cs @@ -0,0 +1,177 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Inworld +{ + /// + /// + /// + [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::Inworld.RpcStatus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [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(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.Modality), TypeInfoPropertyName = "Modality2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.ModelPricing))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.ModelCapabilities))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.ModelSpec))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.Model))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.ListModelsResponse))] + [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(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.Modality?), TypeInfoPropertyName = "NullableModality2")] + [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 ModelsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ModelsSourceGenerationContext : 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 ModelsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ModelsSourceGenerationContext(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::Inworld.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::Inworld.Modality) + + || typeToConvert == typeof(global::Inworld.Modality?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Inworld.Modality)) + { + return new global::Inworld.JsonConverters.ModalityJsonConverter(); + } + + if (typeToConvert == typeof(global::Inworld.Modality?)) + { + return new global::Inworld.JsonConverters.ModalityNullableJsonConverter(); + } + 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 ModelsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Inworld/Generated/Inworld.ModelsClient.Authorizations.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.ModelsClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..e5d8a25 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.ModelsClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Inworld +{ + public sealed partial class ModelsClient + { + + /// + 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::Inworld.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Inworld/Generated/Inworld.ModelsClient.Constructors.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.ModelsClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..ebc4395 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.ModelsClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Inworld +{ + public sealed partial class ModelsClient + { + /// + + public ModelsClient( + 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/Inworld/Generated/Inworld.ModelsClient.g.cs b/src/libs/Inworld/Generated/Inworld.ModelsClient.g.cs index a393ac7..e1da3e2 100644 --- a/src/libs/Inworld/Generated/Inworld.ModelsClient.g.cs +++ b/src/libs/Inworld/Generated/Inworld.ModelsClient.g.cs @@ -35,7 +35,7 @@ public sealed partial class ModelsClient : global::Inworld.IModelsClient, global /// public global::Inworld.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Inworld.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Inworld.ModelsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Inworld/Generated/Inworld.SpeechToText.JsonSerializerContext.g.cs b/src/libs/Inworld/Generated/Inworld.SpeechToText.JsonSerializerContext.g.cs new file mode 100644 index 0000000..019e404 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.SpeechToText.JsonSerializerContext.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace Inworld +{ + /// + /// + /// + [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::Inworld.RpcStatus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [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(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.SttAudioEncoding), TypeInfoPropertyName = "SttAudioEncoding2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.VoiceProfileConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.TranscribeConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.AudioData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.TranscribeRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.WordTimestamp))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.Transcription))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.TranscribeUsage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.TranscribeResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Inworld.SttAudioEncoding?), TypeInfoPropertyName = "NullableSttAudioEncoding2")] + [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::Inworld.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::Inworld.SttAudioEncoding) + + || typeToConvert == typeof(global::Inworld.SttAudioEncoding?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::Inworld.SttAudioEncoding)) + { + return new global::Inworld.JsonConverters.SttAudioEncodingJsonConverter(); + } + + if (typeToConvert == typeof(global::Inworld.SttAudioEncoding?)) + { + return new global::Inworld.JsonConverters.SttAudioEncodingNullableJsonConverter(); + } + 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/Inworld/Generated/Inworld.SpeechToTextClient.Authorizations.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.SpeechToTextClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..9db43e3 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.SpeechToTextClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Inworld +{ + 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::Inworld.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Inworld/Generated/Inworld.SpeechToTextClient.Constructors.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.SpeechToTextClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..c419382 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.SpeechToTextClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Inworld +{ + 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/Inworld/Generated/Inworld.SpeechToTextClient.g.cs b/src/libs/Inworld/Generated/Inworld.SpeechToTextClient.g.cs index 9d01c89..a90806a 100644 --- a/src/libs/Inworld/Generated/Inworld.SpeechToTextClient.g.cs +++ b/src/libs/Inworld/Generated/Inworld.SpeechToTextClient.g.cs @@ -35,7 +35,7 @@ public sealed partial class SpeechToTextClient : global::Inworld.ISpeechToTextCl /// public global::Inworld.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Inworld.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::Inworld.SpeechToTextSourceGenerationContext.Default); /// /// diff --git a/src/libs/Inworld/Generated/Inworld.TextToSpeechClient.Authorizations.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.TextToSpeechClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..b3d8e90 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.TextToSpeechClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Inworld +{ + 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::Inworld.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Inworld/Generated/Inworld.TextToSpeechClient.Constructors.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.TextToSpeechClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..4c47f22 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.TextToSpeechClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Inworld +{ + 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/Inworld/Generated/Inworld.VoicesClient.Authorizations.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.VoicesClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..776ad68 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.VoicesClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace Inworld +{ + 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::Inworld.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/Inworld/Generated/Inworld.VoicesClient.Constructors.Bearer.g.cs b/src/libs/Inworld/Generated/Inworld.VoicesClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..59b0b71 --- /dev/null +++ b/src/libs/Inworld/Generated/Inworld.VoicesClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace Inworld +{ + 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