diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Auth.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Auth.JsonSerializerContext.g.cs new file mode 100644 index 0000000..7d3579a --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Auth.JsonSerializerContext.g.cs @@ -0,0 +1,186 @@ + +#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.CreateAccessTokenRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.AccessTokenResponseTokenType), TypeInfoPropertyName = "AccessTokenResponseTokenType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.AccessTokenResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ValidationErrorResponseStatus), TypeInfoPropertyName = "ValidationErrorResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ValidationErrorResponseErrorsItems))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ValidationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.SimpleErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.AccessTokenResponseTokenType?), TypeInfoPropertyName = "NullableAccessTokenResponseTokenType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ValidationErrorResponseStatus?), TypeInfoPropertyName = "NullableValidationErrorResponseStatus2")] + [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 AuthSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class AuthSourceGenerationContext : 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 AuthSourceGenerationContext Default { get; } = new(DefaultOptions); + + private AuthSourceGenerationContext(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.AccessTokenResponseTokenType) + + || typeToConvert == typeof(global::SmallestAI.AccessTokenResponseTokenType?) + + || typeToConvert == typeof(global::SmallestAI.ValidationErrorResponseStatus) + + || typeToConvert == typeof(global::SmallestAI.ValidationErrorResponseStatus?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::SmallestAI.AccessTokenResponseTokenType)) + { + return new global::SmallestAI.JsonConverters.AccessTokenResponseTokenTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.AccessTokenResponseTokenType?)) + { + return new global::SmallestAI.JsonConverters.AccessTokenResponseTokenTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ValidationErrorResponseStatus)) + { + return new global::SmallestAI.JsonConverters.ValidationErrorResponseStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::SmallestAI.ValidationErrorResponseStatus?)) + { + return new global::SmallestAI.JsonConverters.ValidationErrorResponseStatusNullableJsonConverter(); + } + 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 AuthSourceGenerationContextChunk0(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.AuthClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.AuthClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..6792277 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.AuthClient.Authorizations.Bearer.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class AuthClient + { + + /// + 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.AuthClient.Constructors.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.AuthClient.Constructors.Bearer.g.cs new file mode 100644 index 0000000..aca4c77 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.AuthClient.Constructors.Bearer.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace SmallestAI +{ + public sealed partial class AuthClient + { + /// + + public AuthClient( + 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.AuthClient.CreateAccessToken.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.AuthClient.CreateAccessToken.g.cs new file mode 100644 index 0000000..4768549 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.AuthClient.CreateAccessToken.g.cs @@ -0,0 +1,720 @@ + +#nullable enable + +namespace SmallestAI +{ + public partial class AuthClient + { + + + private static readonly global::SmallestAI.EndPointSecurityRequirement s_CreateAccessTokenSecurityRequirement0 = + new global::SmallestAI.EndPointSecurityRequirement + { + Authorizations = new global::SmallestAI.EndPointAuthorizationRequirement[] + { new global::SmallestAI.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::SmallestAI.EndPointSecurityRequirement[] s_CreateAccessTokenSecurityRequirements = + new global::SmallestAI.EndPointSecurityRequirement[] + { s_CreateAccessTokenSecurityRequirement0, + }; + partial void PrepareCreateAccessTokenArguments( + global::System.Net.Http.HttpClient httpClient, + global::SmallestAI.CreateAccessTokenRequest request); + partial void PrepareCreateAccessTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::SmallestAI.CreateAccessTokenRequest request); + partial void ProcessCreateAccessTokenResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateAccessTokenResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create access token
+ /// Mint a short-lived access token from your API key. Call this from your server,
+ /// then hand the returned `access_token` to a browser or mobile client. The client
+ /// sends it as `Authorization: Bearer <access_token>` on TTS and STT requests. On
+ /// WebSocket connections it can also go in the `api_key` query parameter. HTTP
+ /// requests must use the header.
+ /// A token works any number of times until it expires. It is accepted only on
+ /// TTS, STT and speech-to-speech inference routes: `POST /waves/v1/stt/`, `WSS /waves/v1/stt/live`,
+ /// `POST /waves/v1/tts`, `POST /waves/v1/tts/live`, `WSS /waves/v1/tts/live`, the
+ /// dedicated Lightning v3.1 routes (`POST /waves/v1/lightning-v3.1/get_speech`,
+ /// `POST /waves/v1/lightning-v3.1/stream`, `WSS /waves/v1/lightning-v3.1/get_speech/stream`),
+ /// `WSS /waves/v1/s2s`, and the voice-listing routes. Every other
+ /// route, including this one and `POST /waves/v1/pulse/get_text`, returns `403`
+ /// to a token.
+ /// Requests made with a token are billed to the API key that minted it. Deleting
+ /// that key invalidates its tokens. A token is valid only in the region that
+ /// minted it. If your server and your users can be in different regions, mint and
+ /// call through the same region-pinned hostname (for example `api.us.smallest.ai`).
+ /// ```bash
+ /// curl -X POST "https://api.smallest.ai/waves/v1/auth/token" \
+ /// -H "Authorization: Bearer $SMALLEST_API_KEY" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{"ttl_seconds": 300}'
+ /// ```
+ /// See the [Authentication guide](/models/api-reference/token-based-authentication)
+ /// for the end-to-end server and client flow. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateAccessTokenAsync( + + global::SmallestAI.CreateAccessTokenRequest request, + global::SmallestAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAccessTokenAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create access token
+ /// Mint a short-lived access token from your API key. Call this from your server,
+ /// then hand the returned `access_token` to a browser or mobile client. The client
+ /// sends it as `Authorization: Bearer <access_token>` on TTS and STT requests. On
+ /// WebSocket connections it can also go in the `api_key` query parameter. HTTP
+ /// requests must use the header.
+ /// A token works any number of times until it expires. It is accepted only on
+ /// TTS, STT and speech-to-speech inference routes: `POST /waves/v1/stt/`, `WSS /waves/v1/stt/live`,
+ /// `POST /waves/v1/tts`, `POST /waves/v1/tts/live`, `WSS /waves/v1/tts/live`, the
+ /// dedicated Lightning v3.1 routes (`POST /waves/v1/lightning-v3.1/get_speech`,
+ /// `POST /waves/v1/lightning-v3.1/stream`, `WSS /waves/v1/lightning-v3.1/get_speech/stream`),
+ /// `WSS /waves/v1/s2s`, and the voice-listing routes. Every other
+ /// route, including this one and `POST /waves/v1/pulse/get_text`, returns `403`
+ /// to a token.
+ /// Requests made with a token are billed to the API key that minted it. Deleting
+ /// that key invalidates its tokens. A token is valid only in the region that
+ /// minted it. If your server and your users can be in different regions, mint and
+ /// call through the same region-pinned hostname (for example `api.us.smallest.ai`).
+ /// ```bash
+ /// curl -X POST "https://api.smallest.ai/waves/v1/auth/token" \
+ /// -H "Authorization: Bearer $SMALLEST_API_KEY" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{"ttl_seconds": 300}'
+ /// ```
+ /// See the [Authentication guide](/models/api-reference/token-based-authentication)
+ /// for the end-to-end server and client flow. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAccessTokenAsResponseAsync( + + global::SmallestAI.CreateAccessTokenRequest request, + global::SmallestAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateAccessTokenArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::SmallestAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateAccessTokenSecurityRequirements, + operationName: "CreateAccessTokenAsync"); + + using var __timeoutCancellationTokenSource = global::SmallestAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::SmallestAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::SmallestAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::SmallestAI.PathBuilder( + path: "/waves/v1/auth/token", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::SmallestAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::SmallestAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateAccessTokenRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::SmallestAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::SmallestAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAccessToken", + methodName: "CreateAccessTokenAsync", + pathTemplate: "\"/waves/v1/auth/token\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::SmallestAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::SmallestAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::SmallestAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAccessToken", + methodName: "CreateAccessTokenAsync", + pathTemplate: "\"/waves/v1/auth/token\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::SmallestAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::SmallestAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::SmallestAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::SmallestAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::SmallestAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAccessToken", + methodName: "CreateAccessTokenAsync", + pathTemplate: "\"/waves/v1/auth/token\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::SmallestAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateAccessTokenResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::SmallestAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::SmallestAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAccessToken", + methodName: "CreateAccessTokenAsync", + pathTemplate: "\"/waves/v1/auth/token\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::SmallestAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::SmallestAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAccessToken", + methodName: "CreateAccessTokenAsync", + pathTemplate: "\"/waves/v1/auth/token\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // `ttl_seconds` is not an integer between 30 and 900. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::SmallestAI.ValidationErrorResponse? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::SmallestAI.ValidationErrorResponse.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::SmallestAI.ValidationErrorResponse.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::SmallestAI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Missing or invalid API key. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::SmallestAI.SimpleErrorResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::SmallestAI.SimpleErrorResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::SmallestAI.SimpleErrorResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::SmallestAI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // The request was authenticated with an access token. Only an API key can mint tokens. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::SmallestAI.SimpleErrorResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::SmallestAI.SimpleErrorResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::SmallestAI.SimpleErrorResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::SmallestAI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too many mint requests. Mint one token per client session and retry after a short wait. + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::SmallestAI.SimpleErrorResponse? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::SmallestAI.SimpleErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::SmallestAI.SimpleErrorResponse.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::SmallestAI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Temporarily unavailable. Retry with backoff. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::SmallestAI.SimpleErrorResponse? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::SmallestAI.SimpleErrorResponse.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::SmallestAI.SimpleErrorResponse.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::SmallestAI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateAccessTokenResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::SmallestAI.AccessTokenResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::SmallestAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::SmallestAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::SmallestAI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::SmallestAI.AccessTokenResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::SmallestAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::SmallestAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::SmallestAI.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create access token
+ /// Mint a short-lived access token from your API key. Call this from your server,
+ /// then hand the returned `access_token` to a browser or mobile client. The client
+ /// sends it as `Authorization: Bearer <access_token>` on TTS and STT requests. On
+ /// WebSocket connections it can also go in the `api_key` query parameter. HTTP
+ /// requests must use the header.
+ /// A token works any number of times until it expires. It is accepted only on
+ /// TTS, STT and speech-to-speech inference routes: `POST /waves/v1/stt/`, `WSS /waves/v1/stt/live`,
+ /// `POST /waves/v1/tts`, `POST /waves/v1/tts/live`, `WSS /waves/v1/tts/live`, the
+ /// dedicated Lightning v3.1 routes (`POST /waves/v1/lightning-v3.1/get_speech`,
+ /// `POST /waves/v1/lightning-v3.1/stream`, `WSS /waves/v1/lightning-v3.1/get_speech/stream`),
+ /// `WSS /waves/v1/s2s`, and the voice-listing routes. Every other
+ /// route, including this one and `POST /waves/v1/pulse/get_text`, returns `403`
+ /// to a token.
+ /// Requests made with a token are billed to the API key that minted it. Deleting
+ /// that key invalidates its tokens. A token is valid only in the region that
+ /// minted it. If your server and your users can be in different regions, mint and
+ /// call through the same region-pinned hostname (for example `api.us.smallest.ai`).
+ /// ```bash
+ /// curl -X POST "https://api.smallest.ai/waves/v1/auth/token" \
+ /// -H "Authorization: Bearer $SMALLEST_API_KEY" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{"ttl_seconds": 300}'
+ /// ```
+ /// See the [Authentication guide](/models/api-reference/token-based-authentication)
+ /// for the end-to-end server and client flow. + ///
+ /// + /// How long the token stays valid, in seconds. Between 30 and 900. Defaults to 300 when omitted.
+ /// Default Value: 300 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateAccessTokenAsync( + int? ttlSeconds = default, + global::SmallestAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::SmallestAI.CreateAccessTokenRequest + { + TtlSeconds = ttlSeconds, + }; + + return await CreateAccessTokenAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.AuthClient.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.AuthClient.g.cs new file mode 100644 index 0000000..7816a9e --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.AuthClient.g.cs @@ -0,0 +1,143 @@ + +#nullable enable + +namespace SmallestAI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class AuthClient : global::SmallestAI.IAuthClient, global::System.IDisposable + { + /// + /// waves + /// + public const string DefaultBaseUrl = "https://api.smallest.ai/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::SmallestAI.AutoSDKClientOptions Options { get; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SmallestAI.AuthSourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the AuthClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AuthClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AuthClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AuthClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::SmallestAI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AuthClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AuthClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::SmallestAI.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::SmallestAI.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Electron.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Electron.JsonSerializerContext.g.cs index 26186fc..1022a5e 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.Electron.JsonSerializerContext.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.Electron.JsonSerializerContext.g.cs @@ -18,11 +18,11 @@ namespace SmallestAI [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(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(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))] @@ -53,9 +53,9 @@ namespace SmallestAI [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(int?))] [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")] diff --git a/src/libs/SmallestAI/Generated/SmallestAI.IAuthClient.Authorizations.Bearer.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.IAuthClient.Authorizations.Bearer.g.cs new file mode 100644 index 0000000..c815f69 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.IAuthClient.Authorizations.Bearer.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace SmallestAI +{ + public partial interface IAuthClient + { + /// + /// Authorize using bearer authentication. + /// + /// + + public void AuthorizeUsingBearer( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.IAuthClient.CreateAccessToken.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.IAuthClient.CreateAccessToken.g.cs new file mode 100644 index 0000000..eb22009 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.IAuthClient.CreateAccessToken.g.cs @@ -0,0 +1,121 @@ +#nullable enable + +namespace SmallestAI +{ + public partial interface IAuthClient + { + /// + /// Create access token
+ /// Mint a short-lived access token from your API key. Call this from your server,
+ /// then hand the returned `access_token` to a browser or mobile client. The client
+ /// sends it as `Authorization: Bearer <access_token>` on TTS and STT requests. On
+ /// WebSocket connections it can also go in the `api_key` query parameter. HTTP
+ /// requests must use the header.
+ /// A token works any number of times until it expires. It is accepted only on
+ /// TTS, STT and speech-to-speech inference routes: `POST /waves/v1/stt/`, `WSS /waves/v1/stt/live`,
+ /// `POST /waves/v1/tts`, `POST /waves/v1/tts/live`, `WSS /waves/v1/tts/live`, the
+ /// dedicated Lightning v3.1 routes (`POST /waves/v1/lightning-v3.1/get_speech`,
+ /// `POST /waves/v1/lightning-v3.1/stream`, `WSS /waves/v1/lightning-v3.1/get_speech/stream`),
+ /// `WSS /waves/v1/s2s`, and the voice-listing routes. Every other
+ /// route, including this one and `POST /waves/v1/pulse/get_text`, returns `403`
+ /// to a token.
+ /// Requests made with a token are billed to the API key that minted it. Deleting
+ /// that key invalidates its tokens. A token is valid only in the region that
+ /// minted it. If your server and your users can be in different regions, mint and
+ /// call through the same region-pinned hostname (for example `api.us.smallest.ai`).
+ /// ```bash
+ /// curl -X POST "https://api.smallest.ai/waves/v1/auth/token" \
+ /// -H "Authorization: Bearer $SMALLEST_API_KEY" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{"ttl_seconds": 300}'
+ /// ```
+ /// See the [Authentication guide](/models/api-reference/token-based-authentication)
+ /// for the end-to-end server and client flow. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateAccessTokenAsync( + + global::SmallestAI.CreateAccessTokenRequest request, + global::SmallestAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create access token
+ /// Mint a short-lived access token from your API key. Call this from your server,
+ /// then hand the returned `access_token` to a browser or mobile client. The client
+ /// sends it as `Authorization: Bearer <access_token>` on TTS and STT requests. On
+ /// WebSocket connections it can also go in the `api_key` query parameter. HTTP
+ /// requests must use the header.
+ /// A token works any number of times until it expires. It is accepted only on
+ /// TTS, STT and speech-to-speech inference routes: `POST /waves/v1/stt/`, `WSS /waves/v1/stt/live`,
+ /// `POST /waves/v1/tts`, `POST /waves/v1/tts/live`, `WSS /waves/v1/tts/live`, the
+ /// dedicated Lightning v3.1 routes (`POST /waves/v1/lightning-v3.1/get_speech`,
+ /// `POST /waves/v1/lightning-v3.1/stream`, `WSS /waves/v1/lightning-v3.1/get_speech/stream`),
+ /// `WSS /waves/v1/s2s`, and the voice-listing routes. Every other
+ /// route, including this one and `POST /waves/v1/pulse/get_text`, returns `403`
+ /// to a token.
+ /// Requests made with a token are billed to the API key that minted it. Deleting
+ /// that key invalidates its tokens. A token is valid only in the region that
+ /// minted it. If your server and your users can be in different regions, mint and
+ /// call through the same region-pinned hostname (for example `api.us.smallest.ai`).
+ /// ```bash
+ /// curl -X POST "https://api.smallest.ai/waves/v1/auth/token" \
+ /// -H "Authorization: Bearer $SMALLEST_API_KEY" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{"ttl_seconds": 300}'
+ /// ```
+ /// See the [Authentication guide](/models/api-reference/token-based-authentication)
+ /// for the end-to-end server and client flow. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAccessTokenAsResponseAsync( + + global::SmallestAI.CreateAccessTokenRequest request, + global::SmallestAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create access token
+ /// Mint a short-lived access token from your API key. Call this from your server,
+ /// then hand the returned `access_token` to a browser or mobile client. The client
+ /// sends it as `Authorization: Bearer <access_token>` on TTS and STT requests. On
+ /// WebSocket connections it can also go in the `api_key` query parameter. HTTP
+ /// requests must use the header.
+ /// A token works any number of times until it expires. It is accepted only on
+ /// TTS, STT and speech-to-speech inference routes: `POST /waves/v1/stt/`, `WSS /waves/v1/stt/live`,
+ /// `POST /waves/v1/tts`, `POST /waves/v1/tts/live`, `WSS /waves/v1/tts/live`, the
+ /// dedicated Lightning v3.1 routes (`POST /waves/v1/lightning-v3.1/get_speech`,
+ /// `POST /waves/v1/lightning-v3.1/stream`, `WSS /waves/v1/lightning-v3.1/get_speech/stream`),
+ /// `WSS /waves/v1/s2s`, and the voice-listing routes. Every other
+ /// route, including this one and `POST /waves/v1/pulse/get_text`, returns `403`
+ /// to a token.
+ /// Requests made with a token are billed to the API key that minted it. Deleting
+ /// that key invalidates its tokens. A token is valid only in the region that
+ /// minted it. If your server and your users can be in different regions, mint and
+ /// call through the same region-pinned hostname (for example `api.us.smallest.ai`).
+ /// ```bash
+ /// curl -X POST "https://api.smallest.ai/waves/v1/auth/token" \
+ /// -H "Authorization: Bearer $SMALLEST_API_KEY" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{"ttl_seconds": 300}'
+ /// ```
+ /// See the [Authentication guide](/models/api-reference/token-based-authentication)
+ /// for the end-to-end server and client flow. + ///
+ /// + /// How long the token stays valid, in seconds. Between 30 and 900. Defaults to 300 when omitted.
+ /// Default Value: 300 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateAccessTokenAsync( + int? ttlSeconds = default, + global::SmallestAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.IAuthClient.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.IAuthClient.g.cs new file mode 100644 index 0000000..3374f31 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.IAuthClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace SmallestAI +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IAuthClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::SmallestAI.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.ISmallestAIClient.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.ISmallestAIClient.g.cs index 4f2448a..543c325 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.ISmallestAIClient.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.ISmallestAIClient.g.cs @@ -44,6 +44,11 @@ public partial interface ISmallestAIClient : global::System.IDisposable global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + /// + /// + /// + public AuthClient Auth { get; } + /// /// /// diff --git a/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.AccessTokenResponseTokenType.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.AccessTokenResponseTokenType.g.cs new file mode 100644 index 0000000..7c0024b --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.AccessTokenResponseTokenType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace SmallestAI.JsonConverters +{ + /// + public sealed class AccessTokenResponseTokenTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::SmallestAI.AccessTokenResponseTokenType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::SmallestAI.AccessTokenResponseTokenTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::SmallestAI.AccessTokenResponseTokenType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::SmallestAI.AccessTokenResponseTokenType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::SmallestAI.AccessTokenResponseTokenType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::SmallestAI.AccessTokenResponseTokenTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.AccessTokenResponseTokenTypeNullable.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.AccessTokenResponseTokenTypeNullable.g.cs new file mode 100644 index 0000000..145d200 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.AccessTokenResponseTokenTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace SmallestAI.JsonConverters +{ + /// + public sealed class AccessTokenResponseTokenTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::SmallestAI.AccessTokenResponseTokenType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::SmallestAI.AccessTokenResponseTokenTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::SmallestAI.AccessTokenResponseTokenType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::SmallestAI.AccessTokenResponseTokenType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::SmallestAI.AccessTokenResponseTokenType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::SmallestAI.AccessTokenResponseTokenTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.ValidationErrorResponseStatus.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.ValidationErrorResponseStatus.g.cs new file mode 100644 index 0000000..87ff1db --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.ValidationErrorResponseStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace SmallestAI.JsonConverters +{ + /// + public sealed class ValidationErrorResponseStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::SmallestAI.ValidationErrorResponseStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::SmallestAI.ValidationErrorResponseStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::SmallestAI.ValidationErrorResponseStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::SmallestAI.ValidationErrorResponseStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::SmallestAI.ValidationErrorResponseStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::SmallestAI.ValidationErrorResponseStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.ValidationErrorResponseStatusNullable.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.ValidationErrorResponseStatusNullable.g.cs new file mode 100644 index 0000000..d3370a2 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.JsonConverters.ValidationErrorResponseStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace SmallestAI.JsonConverters +{ + /// + public sealed class ValidationErrorResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::SmallestAI.ValidationErrorResponseStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::SmallestAI.ValidationErrorResponseStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::SmallestAI.ValidationErrorResponseStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::SmallestAI.ValidationErrorResponseStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::SmallestAI.ValidationErrorResponseStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::SmallestAI.ValidationErrorResponseStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/SmallestAI/Generated/SmallestAI.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.JsonSerializerContext.g.cs index 55a4a41..d6bb1fc 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.JsonSerializerContext.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.JsonSerializerContext.g.cs @@ -13,6 +13,14 @@ namespace SmallestAI DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, Converters = new global::System.Type[] { + typeof(global::SmallestAI.JsonConverters.AccessTokenResponseTokenTypeJsonConverter), + + typeof(global::SmallestAI.JsonConverters.AccessTokenResponseTokenTypeNullableJsonConverter), + + typeof(global::SmallestAI.JsonConverters.ValidationErrorResponseStatusJsonConverter), + + typeof(global::SmallestAI.JsonConverters.ValidationErrorResponseStatusNullableJsonConverter), + typeof(global::SmallestAI.JsonConverters.WavesV1TtsPostParametersAcceptJsonConverter), typeof(global::SmallestAI.JsonConverters.WavesV1TtsPostParametersAcceptNullableJsonConverter), @@ -139,6 +147,18 @@ namespace SmallestAI })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.JsonSerializerContextTypes))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.CreateAccessTokenRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.AccessTokenResponseTokenType), TypeInfoPropertyName = "AccessTokenResponseTokenType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.AccessTokenResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ValidationErrorResponseStatus), TypeInfoPropertyName = "ValidationErrorResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ValidationErrorResponseErrorsItems))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ValidationErrorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.SimpleErrorResponse))] [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")] @@ -147,10 +167,8 @@ namespace SmallestAI [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(global::SmallestAI.WavesV1ModelGetVoicesGetParametersModel), TypeInfoPropertyName = "WavesV1ModelGetVoicesGetParametersModel2")] @@ -166,7 +184,6 @@ namespace SmallestAI [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))] @@ -198,7 +215,6 @@ namespace SmallestAI [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))] @@ -244,6 +260,7 @@ namespace SmallestAI [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] diff --git a/src/libs/SmallestAI/Generated/SmallestAI.JsonSerializerContextTypes.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.JsonSerializerContextTypes.g.cs index cd7d8ce..b432f24 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.JsonSerializerContextTypes.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.JsonSerializerContextTypes.g.cs @@ -33,419 +33,451 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::SmallestAI.WavesV1TtsPostParametersAccept? Type0 { get; set; } + public global::SmallestAI.CreateAccessTokenRequest? Type0 { get; set; } /// /// /// - public global::SmallestAI.WavesV1TtsPostParametersXExpireContent? Type1 { get; set; } + public int? Type1 { get; set; } /// /// /// - public global::SmallestAI.TtsRequestModel? Type2 { get; set; } + public global::SmallestAI.AccessTokenResponseTokenType? Type2 { get; set; } /// /// /// - public global::SmallestAI.TtsRequestSampleRate? Type3 { get; set; } + public global::SmallestAI.AccessTokenResponse? Type3 { get; set; } /// /// /// - public global::SmallestAI.TtsRequestLanguage? Type4 { get; set; } + public string? Type4 { get; set; } /// /// /// - public global::SmallestAI.TtsRequestNumberPronunciationLanguage? Type5 { get; set; } + public global::System.DateTime? Type5 { get; set; } /// /// /// - public global::SmallestAI.TtsRequestOutputFormat? Type6 { get; set; } + public global::SmallestAI.ValidationErrorResponseStatus? Type6 { get; set; } /// /// /// - public global::SmallestAI.TtsRequest? Type7 { get; set; } + public global::SmallestAI.ValidationErrorResponseErrorsItems? Type7 { get; set; } /// /// /// - public string? Type8 { get; set; } + public global::System.Collections.Generic.IList? Type8 { get; set; } /// /// /// - public double? Type9 { get; set; } + public global::SmallestAI.ValidationErrorResponse? Type9 { get; set; } /// /// /// - public bool? Type10 { get; set; } + public global::System.Collections.Generic.IList? Type10 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type11 { get; set; } + public global::SmallestAI.SimpleErrorResponse? Type11 { get; set; } /// /// /// - public global::SmallestAI.TtsError? Type12 { get; set; } + public global::SmallestAI.WavesV1TtsPostParametersAccept? Type12 { get; set; } /// /// /// - public global::SmallestAI.WavesV1TtsLivePostParametersXExpireContent? Type13 { get; set; } + public global::SmallestAI.WavesV1TtsPostParametersXExpireContent? Type13 { get; set; } /// /// /// - public global::SmallestAI.WavesV1ModelGetVoicesGetParametersModel? Type14 { get; set; } + public global::SmallestAI.TtsRequestModel? Type14 { get; set; } /// /// /// - public global::SmallestAI.WavesV1ModelGetVoicesGetResponsesContentApplicationJsonSchemaVoicesItemsTags? Type15 { get; set; } + public global::SmallestAI.TtsRequestSampleRate? Type15 { get; set; } /// /// /// - public global::SmallestAI.WavesV1ModelGetVoicesGetResponsesContentApplicationJsonSchemaVoicesItems? Type16 { get; set; } + public global::SmallestAI.TtsRequestLanguage? Type16 { get; set; } /// /// /// - public global::SmallestAI.VoicesGetWavesVoicesResponse200? Type17 { get; set; } + public global::SmallestAI.TtsRequestNumberPronunciationLanguage? Type17 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type18 { get; set; } + public global::SmallestAI.TtsRequestOutputFormat? Type18 { get; set; } /// /// /// - public global::SmallestAI.GetWavesVoicesRequestBadRequestError? Type19 { get; set; } + public global::SmallestAI.TtsRequest? Type19 { get; set; } /// /// /// - public global::SmallestAI.GetWavesVoicesRequestUnauthorizedError? Type20 { get; set; } + public double? Type20 { get; set; } /// /// /// - public global::SmallestAI.GetWavesVoicesRequestInternalServerError? Type21 { get; set; } + public bool? Type21 { get; set; } /// /// /// - public global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguage? Type22 { get; set; } + public global::SmallestAI.TtsError? Type22 { get; set; } /// /// /// - public global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModel? Type23 { get; set; } + public global::SmallestAI.WavesV1TtsLivePostParametersXExpireContent? Type23 { get; set; } /// /// /// - public global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatus? Type24 { get; set; } + public global::SmallestAI.WavesV1ModelGetVoicesGetParametersModel? Type24 { get; set; } /// /// /// - public global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataSamplesItems? Type25 { get; set; } + public global::SmallestAI.WavesV1ModelGetVoicesGetResponsesContentApplicationJsonSchemaVoicesItemsTags? Type25 { get; set; } /// /// /// - public global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaData? Type26 { get; set; } + public global::SmallestAI.WavesV1ModelGetVoicesGetResponsesContentApplicationJsonSchemaVoicesItems? Type26 { get; set; } /// /// /// - public global::System.DateTime? Type27 { get; set; } + public global::SmallestAI.VoicesGetWavesVoicesResponse200? Type27 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type28 { get; set; } + public global::System.Collections.Generic.IList? Type28 { get; set; } /// /// /// - public global::SmallestAI.VoiceCloningCreateVoiceCloneResponse200? Type29 { get; set; } + public global::SmallestAI.GetWavesVoicesRequestBadRequestError? Type29 { get; set; } /// /// /// - public global::SmallestAI.CreateVoiceCloneRequestBadRequestError? Type30 { get; set; } + public global::SmallestAI.GetWavesVoicesRequestUnauthorizedError? Type30 { get; set; } /// /// /// - public global::SmallestAI.CreateVoiceCloneRequestUnauthorizedError? Type31 { get; set; } + public global::SmallestAI.GetWavesVoicesRequestInternalServerError? Type31 { get; set; } /// /// /// - public global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCode? Type32 { get; set; } + public global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaLanguage? Type32 { get; set; } /// /// /// - public global::SmallestAI.CreateVoiceCloneRequestInternalServerError? Type33 { get; set; } + public global::SmallestAI.WavesV1VoiceCloningPostRequestBodyContentMultipartFormDataSchemaModel? Type33 { get; set; } /// /// /// - public global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatus? Type34 { get; set; } + public global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataStatus? Type34 { get; set; } /// /// /// - public global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningType? Type35 { get; set; } + public global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaDataSamplesItems? Type35 { get; set; } /// /// /// - public global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItems? Type36 { get; set; } + public global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaData? Type36 { get; set; } /// /// /// - public global::SmallestAI.VoiceCloningListVoiceClonesResponse200? Type37 { get; set; } + public global::System.Collections.Generic.IList? Type37 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type38 { get; set; } + public global::SmallestAI.VoiceCloningCreateVoiceCloneResponse200? Type38 { get; set; } /// /// /// - public global::SmallestAI.PronunciationItem? Type39 { get; set; } + public global::SmallestAI.CreateVoiceCloneRequestBadRequestError? Type39 { get; set; } /// /// /// - public global::SmallestAI.PronunciationDict? Type40 { get; set; } + public global::SmallestAI.CreateVoiceCloneRequestUnauthorizedError? Type40 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type41 { get; set; } + public global::SmallestAI.WavesV1VoiceCloningPostResponsesContentApplicationJsonSchemaErrorCode? Type41 { get; set; } /// /// /// - public global::SmallestAI.ErrorResponseDetailsItems? Type42 { get; set; } + public global::SmallestAI.CreateVoiceCloneRequestInternalServerError? Type42 { get; set; } /// /// /// - public global::SmallestAI.ErrorResponse? Type43 { get; set; } + public global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsStatus? Type43 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type44 { get; set; } + public global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItemsCloningType? Type44 { get; set; } /// /// /// - public global::SmallestAI.CreatePronunciationDictRequest? Type45 { get; set; } + public global::SmallestAI.WavesV1VoiceCloningGetResponsesContentApplicationJsonSchemaDataItems? Type45 { get; set; } /// /// /// - public global::SmallestAI.UpdatePronunciationDictRequest? Type46 { get; set; } + public global::SmallestAI.VoiceCloningListVoiceClonesResponse200? Type46 { get; set; } /// /// /// - public global::SmallestAI.UpdatePronunciationDictResponse? Type47 { get; set; } + public global::System.Collections.Generic.IList? Type47 { get; set; } /// /// /// - public global::SmallestAI.DeletePronunciationDictRequest? Type48 { get; set; } + public global::SmallestAI.PronunciationItem? Type48 { get; set; } /// /// /// - public global::SmallestAI.DeletePronunciationDictResponse? Type49 { get; set; } + public global::SmallestAI.PronunciationDict? Type49 { get; set; } /// /// /// - public global::SmallestAI.WavesV1SttPostParametersModel? Type50 { get; set; } + public global::System.Collections.Generic.IList? Type50 { get; set; } /// /// /// - public global::SmallestAI.WavesV1SttPostParametersLanguage? Type51 { get; set; } + public global::SmallestAI.ErrorResponseDetailsItems? Type51 { get; set; } /// /// /// - public global::SmallestAI.WavesV1SttPostParametersWebhookMethod? Type52 { get; set; } + public global::SmallestAI.ErrorResponse? Type52 { get; set; } /// /// /// - public global::SmallestAI.WavesV1SttPostParametersRedactPii? Type53 { get; set; } + public global::System.Collections.Generic.IList? Type53 { get; set; } /// /// /// - public global::SmallestAI.WavesV1SttPostParametersRedactPci? Type54 { get; set; } + public global::SmallestAI.CreatePronunciationDictRequest? Type54 { get; set; } /// /// /// - public global::SmallestAI.WavesV1SttPostParametersEmotionDetection? Type55 { get; set; } + public global::SmallestAI.UpdatePronunciationDictRequest? Type55 { get; set; } /// /// /// - public global::SmallestAI.WavesV1SttPostParametersGenderDetection? Type56 { get; set; } + public global::SmallestAI.UpdatePronunciationDictResponse? Type56 { get; set; } /// /// /// - public global::SmallestAI.WavesV1SttPostParametersXExpireContent? Type57 { get; set; } + public global::SmallestAI.DeletePronunciationDictRequest? Type57 { get; set; } /// /// /// - public global::SmallestAI.Word? Type58 { get; set; } + public global::SmallestAI.DeletePronunciationDictResponse? Type58 { get; set; } /// /// /// - public int? Type59 { get; set; } + public global::SmallestAI.WavesV1SttPostParametersModel? Type59 { get; set; } /// /// /// - public global::SmallestAI.Utterance? Type60 { get; set; } + public global::SmallestAI.WavesV1SttPostParametersLanguage? Type60 { get; set; } /// /// /// - public global::SmallestAI.TranscriptionResponseMetadata? Type61 { get; set; } + public global::SmallestAI.WavesV1SttPostParametersWebhookMethod? Type61 { get; set; } /// /// /// - public global::SmallestAI.TranscriptionResponse? Type62 { get; set; } + public global::SmallestAI.WavesV1SttPostParametersRedactPii? Type62 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type63 { get; set; } + public global::SmallestAI.WavesV1SttPostParametersRedactPci? Type63 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type64 { get; set; } + public global::SmallestAI.WavesV1SttPostParametersEmotionDetection? Type64 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type65 { get; set; } + public global::SmallestAI.WavesV1SttPostParametersGenderDetection? Type65 { get; set; } /// /// /// - public global::SmallestAI.AsyncAccepted? Type66 { get; set; } + public global::SmallestAI.WavesV1SttPostParametersXExpireContent? Type66 { get; set; } /// /// /// - public global::SmallestAI.SpeechToTextTranscribeResponse200? Type67 { get; set; } + public global::SmallestAI.Word? Type67 { get; set; } /// /// /// - public global::SmallestAI.SttErrorResponseDetailsItems? Type68 { get; set; } + public global::SmallestAI.Utterance? Type68 { get; set; } /// /// /// - public global::SmallestAI.SttErrorResponse? Type69 { get; set; } + public global::SmallestAI.TranscriptionResponseMetadata? Type69 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type70 { get; set; } + public global::SmallestAI.TranscriptionResponse? Type70 { get; set; } /// /// /// - public global::SmallestAI.ElectronToolCallType? Type71 { get; set; } + public global::System.Collections.Generic.IList? Type71 { get; set; } /// /// /// - public global::SmallestAI.ElectronToolCallFunction? Type72 { get; set; } + public global::System.Collections.Generic.IList? Type72 { get; set; } /// /// /// - public global::SmallestAI.ElectronToolCall? Type73 { get; set; } + public global::System.Collections.Generic.Dictionary? Type73 { get; set; } /// /// /// - public global::SmallestAI.ElectronMessage? Type74 { get; set; } + public global::SmallestAI.AsyncAccepted? Type74 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type75 { get; set; } + public global::SmallestAI.SpeechToTextTranscribeResponse200? Type75 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionRequestStreamOptions? Type76 { get; set; } + public global::SmallestAI.SttErrorResponseDetailsItems? Type76 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionRequestToolChoice0? Type77 { get; set; } + public global::SmallestAI.SttErrorResponse? Type77 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Type? Type78 { get; set; } + public global::System.Collections.Generic.IList? Type78 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Function? Type79 { get; set; } + public global::SmallestAI.ElectronToolCallType? Type79 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionRequestToolChoice1? Type80 { get; set; } + public global::SmallestAI.ElectronToolCallFunction? Type80 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionRequestToolChoice? Type81 { get; set; } + public global::SmallestAI.ElectronToolCall? Type81 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionRequestResponseFormatType? Type82 { get; set; } + public global::SmallestAI.ElectronMessage? Type82 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionRequestResponseFormat? Type83 { get; set; } + public global::System.Collections.Generic.IList? Type83 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionRequestStop? Type84 { get; set; } + public global::SmallestAI.ChatCompletionRequestStreamOptions? Type84 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionRequest? Type85 { get; set; } + public global::SmallestAI.ChatCompletionRequestToolChoice0? Type85 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type86 { get; set; } + public global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Type? Type86 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type87 { get; set; } + public global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Function? Type87 { get; set; } /// /// /// - public object? Type88 { get; set; } + public global::SmallestAI.ChatCompletionRequestToolChoice1? Type88 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionObject? Type89 { get; set; } + public global::SmallestAI.ChatCompletionRequestToolChoice? Type89 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionChoicesItemsFinishReason? Type90 { get; set; } + public global::SmallestAI.ChatCompletionRequestResponseFormatType? Type90 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletionChoicesItems? Type91 { get; set; } + public global::SmallestAI.ChatCompletionRequestResponseFormat? Type91 { get; set; } /// /// /// - public global::SmallestAI.UsagePromptTokensDetails? Type92 { get; set; } + public global::SmallestAI.ChatCompletionRequestStop? Type92 { get; set; } /// /// /// - public global::SmallestAI.Usage? Type93 { get; set; } + public global::SmallestAI.ChatCompletionRequest? Type93 { get; set; } /// /// /// - public global::SmallestAI.ChatCompletion? Type94 { get; set; } + public global::System.Collections.Generic.IList? Type94 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type95 { get; set; } + public global::System.Collections.Generic.IList? Type95 { get; set; } /// /// /// - public global::SmallestAI.ErrorErrorDetailsItems? Type96 { get; set; } + public object? Type96 { get; set; } /// /// /// - public global::SmallestAI.ErrorError? Type97 { get; set; } + public global::SmallestAI.ChatCompletionObject? Type97 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type98 { get; set; } + public global::SmallestAI.ChatCompletionChoicesItemsFinishReason? Type98 { get; set; } /// /// /// - public global::SmallestAI.Error? Type99 { get; set; } + public global::SmallestAI.ChatCompletionChoicesItems? Type99 { get; set; } /// /// /// - public global::SmallestAI.TranscriptionUrlRequest? Type100 { get; set; } + public global::SmallestAI.UsagePromptTokensDetails? Type100 { get; set; } /// /// /// - public global::SmallestAI.CreateVoiceCloneRequest? Type101 { get; set; } + public global::SmallestAI.Usage? Type101 { get; set; } /// /// /// - public byte[]? Type102 { get; set; } + public global::SmallestAI.ChatCompletion? Type102 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type103 { get; set; } + public global::System.Collections.Generic.IList? Type103 { get; set; } + /// + /// + /// + public global::SmallestAI.ErrorErrorDetailsItems? Type104 { get; set; } + /// + /// + /// + public global::SmallestAI.ErrorError? Type105 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type106 { get; set; } + /// + /// + /// + public global::SmallestAI.Error? Type107 { get; set; } + /// + /// + /// + public global::SmallestAI.TranscriptionUrlRequest? Type108 { get; set; } + /// + /// + /// + public global::SmallestAI.CreateVoiceCloneRequest? Type109 { get; set; } + /// + /// + /// + public byte[]? Type110 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type111 { get; set; } /// /// @@ -454,58 +486,62 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType1 { get; set; } + public global::System.Collections.Generic.List? ListType1 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType2 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType2 { get; set; } + public global::System.Collections.Generic.List? ListType3 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType3 { get; set; } + public global::System.Collections.Generic.List? ListType4 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType4 { get; set; } + public global::System.Collections.Generic.List? ListType5 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType5 { get; set; } + public global::System.Collections.Generic.List? ListType6 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType6 { get; set; } + public global::System.Collections.Generic.List? ListType7 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType7 { get; set; } + public global::System.Collections.Generic.List? ListType8 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType8 { get; set; } + public global::System.Collections.Generic.List? ListType9 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType9 { get; set; } + public global::System.Collections.Generic.List? ListType10 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType10 { get; set; } + public global::System.Collections.Generic.List? ListType11 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType11 { get; set; } + public global::System.Collections.Generic.List? ListType12 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType12 { get; set; } + public global::System.Collections.Generic.List? ListType13 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType13 { get; set; } + public global::System.Collections.Generic.List? ListType14 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType14 { get; set; } + public global::System.Collections.Generic.List? ListType15 { get; set; } } } \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.AccessTokenResponse.Json.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.AccessTokenResponse.Json.g.cs new file mode 100644 index 0000000..af34363 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.AccessTokenResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace SmallestAI +{ + public sealed partial class AccessTokenResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::SmallestAI.AccessTokenResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::SmallestAI.AccessTokenResponse), + jsonSerializerContext) as global::SmallestAI.AccessTokenResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::SmallestAI.AccessTokenResponse? FromJson( + string json) + { + return FromJson( + json, + global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::SmallestAI.AccessTokenResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::SmallestAI.AccessTokenResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::SmallestAI.AccessTokenResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.AccessTokenResponse.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.AccessTokenResponse.g.cs new file mode 100644 index 0000000..5e035cd --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.AccessTokenResponse.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace SmallestAI +{ + /// + /// + /// + public sealed partial class AccessTokenResponse + { + /// + /// The short-lived token. Always starts with `wat_`. Send it as `Authorization: Bearer <access_token>`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("access_token")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AccessToken { get; set; } + + /// + /// Always `Bearer`. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("token_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::SmallestAI.JsonConverters.AccessTokenResponseTokenTypeJsonConverter))] + public global::SmallestAI.AccessTokenResponseTokenType TokenType { get; set; } + + /// + /// Seconds until the token expires, equal to the `ttl_seconds` that was applied. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("expires_in")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int ExpiresIn { get; set; } + + /// + /// Expiry time in UTC (ISO 8601). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("expires_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime ExpiresAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The short-lived token. Always starts with `wat_`. Send it as `Authorization: Bearer <access_token>`. + /// + /// + /// Seconds until the token expires, equal to the `ttl_seconds` that was applied. + /// + /// + /// Expiry time in UTC (ISO 8601). + /// + /// + /// Always `Bearer`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AccessTokenResponse( + string accessToken, + int expiresIn, + global::System.DateTime expiresAt, + global::SmallestAI.AccessTokenResponseTokenType tokenType) + { + this.AccessToken = accessToken ?? throw new global::System.ArgumentNullException(nameof(accessToken)); + this.TokenType = tokenType; + this.ExpiresIn = expiresIn; + this.ExpiresAt = expiresAt; + } + + /// + /// Initializes a new instance of the class. + /// + public AccessTokenResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.AccessTokenResponseTokenType.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.AccessTokenResponseTokenType.g.cs new file mode 100644 index 0000000..98125e3 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.AccessTokenResponseTokenType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace SmallestAI +{ + /// + /// Always `Bearer`. + /// + public enum AccessTokenResponseTokenType + { + /// + /// + /// + Bearer, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AccessTokenResponseTokenTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AccessTokenResponseTokenType value) + { + return value switch + { + AccessTokenResponseTokenType.Bearer => "Bearer", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AccessTokenResponseTokenType? ToEnum(string value) + { + return value switch + { + "Bearer" => AccessTokenResponseTokenType.Bearer, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.CreateAccessTokenRequest.Json.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.CreateAccessTokenRequest.Json.g.cs new file mode 100644 index 0000000..ad249c6 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.CreateAccessTokenRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace SmallestAI +{ + public sealed partial class CreateAccessTokenRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::SmallestAI.CreateAccessTokenRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::SmallestAI.CreateAccessTokenRequest), + jsonSerializerContext) as global::SmallestAI.CreateAccessTokenRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::SmallestAI.CreateAccessTokenRequest? FromJson( + string json) + { + return FromJson( + json, + global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::SmallestAI.CreateAccessTokenRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::SmallestAI.CreateAccessTokenRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::SmallestAI.CreateAccessTokenRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.CreateAccessTokenRequest.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.CreateAccessTokenRequest.g.cs new file mode 100644 index 0000000..e754bd1 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.CreateAccessTokenRequest.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace SmallestAI +{ + /// + /// + /// + public sealed partial class CreateAccessTokenRequest + { + /// + /// How long the token stays valid, in seconds. Between 30 and 900. Defaults to 300 when omitted.
+ /// Default Value: 300 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("ttl_seconds")] + public int? TtlSeconds { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// How long the token stays valid, in seconds. Between 30 and 900. Defaults to 300 when omitted.
+ /// Default Value: 300 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CreateAccessTokenRequest( + int? ttlSeconds) + { + this.TtlSeconds = ttlSeconds; + } + + /// + /// Initializes a new instance of the class. + /// + public CreateAccessTokenRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.SimpleErrorResponse.Json.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.SimpleErrorResponse.Json.g.cs new file mode 100644 index 0000000..c49c908 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.SimpleErrorResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace SmallestAI +{ + public sealed partial class SimpleErrorResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::SmallestAI.SimpleErrorResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::SmallestAI.SimpleErrorResponse), + jsonSerializerContext) as global::SmallestAI.SimpleErrorResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::SmallestAI.SimpleErrorResponse? FromJson( + string json) + { + return FromJson( + json, + global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::SmallestAI.SimpleErrorResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::SmallestAI.SimpleErrorResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::SmallestAI.SimpleErrorResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.SimpleErrorResponse.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.SimpleErrorResponse.g.cs new file mode 100644 index 0000000..6d5006a --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.SimpleErrorResponse.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace SmallestAI +{ + /// + /// + /// + public sealed partial class SimpleErrorResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public string? Error { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SimpleErrorResponse( + string? error) + { + this.Error = error; + } + + /// + /// Initializes a new instance of the class. + /// + public SimpleErrorResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponse.Json.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponse.Json.g.cs new file mode 100644 index 0000000..b5ffdec --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace SmallestAI +{ + public sealed partial class ValidationErrorResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::SmallestAI.ValidationErrorResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::SmallestAI.ValidationErrorResponse), + jsonSerializerContext) as global::SmallestAI.ValidationErrorResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::SmallestAI.ValidationErrorResponse? FromJson( + string json) + { + return FromJson( + json, + global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::SmallestAI.ValidationErrorResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::SmallestAI.ValidationErrorResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::SmallestAI.ValidationErrorResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponse.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponse.g.cs new file mode 100644 index 0000000..85d47f2 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponse.g.cs @@ -0,0 +1,65 @@ + +#nullable enable + +namespace SmallestAI +{ + /// + /// + /// + public sealed partial class ValidationErrorResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::SmallestAI.JsonConverters.ValidationErrorResponseStatusJsonConverter))] + public global::SmallestAI.ValidationErrorResponseStatus? Status { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// One entry per failed field. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("errors")] + public global::System.Collections.Generic.IList? Errors { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// One entry per failed field. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ValidationErrorResponse( + global::SmallestAI.ValidationErrorResponseStatus? status, + string? message, + global::System.Collections.Generic.IList? errors) + { + this.Status = status; + this.Message = message; + this.Errors = errors; + } + + /// + /// Initializes a new instance of the class. + /// + public ValidationErrorResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponseErrorsItems.Json.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponseErrorsItems.Json.g.cs new file mode 100644 index 0000000..55431ac --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponseErrorsItems.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace SmallestAI +{ + public sealed partial class ValidationErrorResponseErrorsItems + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::SmallestAI.ValidationErrorResponseErrorsItems? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::SmallestAI.ValidationErrorResponseErrorsItems), + jsonSerializerContext) as global::SmallestAI.ValidationErrorResponseErrorsItems; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::SmallestAI.ValidationErrorResponseErrorsItems? FromJson( + string json) + { + return FromJson( + json, + global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::SmallestAI.ValidationErrorResponseErrorsItems? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::SmallestAI.ValidationErrorResponseErrorsItems), + jsonSerializerContext).ConfigureAwait(false)) as global::SmallestAI.ValidationErrorResponseErrorsItems; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::SmallestAI.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::SmallestAI.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponseErrorsItems.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponseErrorsItems.g.cs new file mode 100644 index 0000000..ada5255 --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponseErrorsItems.g.cs @@ -0,0 +1,62 @@ + +#nullable enable + +namespace SmallestAI +{ + /// + /// + /// + public sealed partial class ValidationErrorResponseErrorsItems + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("path")] + public global::System.Collections.Generic.IList? Path { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ValidationErrorResponseErrorsItems( + string? code, + string? message, + global::System.Collections.Generic.IList? path) + { + this.Code = code; + this.Message = message; + this.Path = path; + } + + /// + /// Initializes a new instance of the class. + /// + public ValidationErrorResponseErrorsItems() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponseStatus.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponseStatus.g.cs new file mode 100644 index 0000000..6df26ac --- /dev/null +++ b/src/libs/SmallestAI/Generated/SmallestAI.Models.ValidationErrorResponseStatus.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace SmallestAI +{ + /// + /// + /// + public enum ValidationErrorResponseStatus + { + /// + /// + /// + Error, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ValidationErrorResponseStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ValidationErrorResponseStatus value) + { + return value switch + { + ValidationErrorResponseStatus.Error => "error", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ValidationErrorResponseStatus? ToEnum(string value) + { + return value switch + { + "error" => ValidationErrorResponseStatus.Error, + _ => null, + }; + } + } +} \ 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 index 546eda5..65056f4 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionaries.JsonSerializerContext.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.PronunciationDictionaries.JsonSerializerContext.g.cs @@ -19,8 +19,8 @@ namespace SmallestAI [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(bool))] [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))] @@ -33,8 +33,8 @@ namespace SmallestAI [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(bool?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] diff --git a/src/libs/SmallestAI/Generated/SmallestAI.SmallestAIClient.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.SmallestAIClient.g.cs index b8c37e3..f084928 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.SmallestAIClient.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.SmallestAIClient.g.cs @@ -46,6 +46,15 @@ public sealed partial class SmallestAIClient : global::SmallestAI.ISmallestAICli } + /// + /// + /// + public AuthClient Auth => new AuthClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + /// /// /// diff --git a/src/libs/SmallestAI/Generated/SmallestAI.SpeechToText.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.SpeechToText.JsonSerializerContext.g.cs index ee83ab1..59c1d4d 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.SpeechToText.JsonSerializerContext.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.SpeechToText.JsonSerializerContext.g.cs @@ -18,6 +18,7 @@ namespace SmallestAI [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(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] @@ -30,7 +31,6 @@ namespace SmallestAI [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))] @@ -44,6 +44,7 @@ namespace SmallestAI [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(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::SmallestAI.WavesV1SttPostParametersModel?), TypeInfoPropertyName = "NullableWavesV1SttPostParametersModel2")] @@ -54,7 +55,6 @@ namespace SmallestAI [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))] diff --git a/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeech.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeech.JsonSerializerContext.g.cs index faa5f35..f510b2a 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeech.JsonSerializerContext.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.TextToSpeech.JsonSerializerContext.g.cs @@ -18,6 +18,8 @@ namespace SmallestAI [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.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")] @@ -26,10 +28,8 @@ namespace SmallestAI [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[]))] diff --git a/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloning.JsonSerializerContext.g.cs b/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloning.JsonSerializerContext.g.cs index 03bb6c8..a9d07d2 100644 --- a/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloning.JsonSerializerContext.g.cs +++ b/src/libs/SmallestAI/Generated/SmallestAI.VoiceCloning.JsonSerializerContext.g.cs @@ -19,13 +19,13 @@ namespace SmallestAI [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.DateTime))] [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))] @@ -40,10 +40,10 @@ namespace SmallestAI [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::System.DateTime?))] [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")] diff --git a/src/libs/SmallestAI/openapi.yaml b/src/libs/SmallestAI/openapi.yaml index e286e90..4e117f3 100644 --- a/src/libs/SmallestAI/openapi.yaml +++ b/src/libs/SmallestAI/openapi.yaml @@ -5,6 +5,92 @@ "version": "1.0.0" }, "paths": { + "/waves/v1/auth/token": { + "post": { + "operationId": "auth_create_access_token", + "summary": "Create access token", + "description": "Mint a short-lived access token from your API key. Call this from your server,\nthen hand the returned `access_token` to a browser or mobile client. The client\nsends it as `Authorization: Bearer ` on TTS and STT requests. On\nWebSocket connections it can also go in the `api_key` query parameter. HTTP\nrequests must use the header.\n\nA token works any number of times until it expires. It is accepted only on\nTTS, STT and speech-to-speech inference routes: `POST /waves/v1/stt/`, `WSS /waves/v1/stt/live`,\n`POST /waves/v1/tts`, `POST /waves/v1/tts/live`, `WSS /waves/v1/tts/live`, the\ndedicated Lightning v3.1 routes (`POST /waves/v1/lightning-v3.1/get_speech`,\n`POST /waves/v1/lightning-v3.1/stream`, `WSS /waves/v1/lightning-v3.1/get_speech/stream`),\n`WSS /waves/v1/s2s`, and the voice-listing routes. Every other\nroute, including this one and `POST /waves/v1/pulse/get_text`, returns `403`\nto a token.\n\nRequests made with a token are billed to the API key that minted it. Deleting\nthat key invalidates its tokens. A token is valid only in the region that\nminted it. If your server and your users can be in different regions, mint and\ncall through the same region-pinned hostname (for example `api.us.smallest.ai`).\n\n```bash\ncurl -X POST \"https://api.smallest.ai/waves/v1/auth/token\" \\\n -H \"Authorization: Bearer $SMALLEST_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"ttl_seconds\": 300}'\n```\n\nSee the [Authentication guide](/models/api-reference/token-based-authentication)\nfor the end-to-end server and client flow.\n", + "tags": [ + "auth" + ], + "responses": { + "201": { + "description": "Token created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessTokenResponse" + } + } + } + }, + "400": { + "description": "`ttl_seconds` is not an integer between 30 and 900.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationErrorResponse" + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleErrorResponse" + } + } + } + }, + "403": { + "description": "The request was authenticated with an access token. Only an API key can mint tokens.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleErrorResponse" + } + } + } + }, + "429": { + "description": "Too many mint requests. Mint one token per client session and retry after a short wait.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleErrorResponse" + } + } + } + }, + "503": { + "description": "Temporarily unavailable. Retry with backoff.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleErrorResponse" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateAccessTokenRequest" + } + } + } + }, + "security": [ + { + "BearerAuth": [] + } + ] + } + }, "/waves/v1/tts": { "post": { "operationId": "textToSpeech_synthesizeSpeech", @@ -950,6 +1036,9 @@ } }, "tags": [ + { + "name": "auth" + }, { "name": "textToSpeech" }, @@ -977,6 +1066,109 @@ ], "components": { "schemas": { + "CreateAccessTokenRequest": { + "type": "object", + "properties": { + "ttl_seconds": { + "type": "integer", + "minimum": 30, + "maximum": 900, + "default": 300, + "description": "How long the token stays valid, in seconds. Between 30 and 900. Defaults to 300 when omitted." + } + }, + "title": "CreateAccessTokenRequest" + }, + "AccessTokenResponseTokenType": { + "type": "string", + "enum": [ + "Bearer" + ], + "description": "Always `Bearer`.", + "title": "AccessTokenResponseTokenType" + }, + "AccessTokenResponse": { + "type": "object", + "properties": { + "access_token": { + "type": "string", + "description": "The short-lived token. Always starts with `wat_`. Send it as `Authorization: Bearer `." + }, + "token_type": { + "$ref": "#/components/schemas/AccessTokenResponseTokenType", + "description": "Always `Bearer`." + }, + "expires_in": { + "type": "integer", + "description": "Seconds until the token expires, equal to the `ttl_seconds` that was applied." + }, + "expires_at": { + "type": "string", + "format": "date-time", + "description": "Expiry time in UTC (ISO 8601)." + } + }, + "required": [ + "access_token", + "token_type", + "expires_in", + "expires_at" + ], + "title": "AccessTokenResponse" + }, + "ValidationErrorResponseStatus": { + "type": "string", + "enum": [ + "error" + ], + "title": "ValidationErrorResponseStatus" + }, + "ValidationErrorResponseErrorsItems": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "path": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "ValidationErrorResponseErrorsItems" + }, + "ValidationErrorResponse": { + "type": "object", + "properties": { + "status": { + "$ref": "#/components/schemas/ValidationErrorResponseStatus" + }, + "message": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ValidationErrorResponseErrorsItems" + }, + "description": "One entry per failed field." + } + }, + "title": "ValidationErrorResponse" + }, + "SimpleErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + }, + "title": "SimpleErrorResponse" + }, "WavesV1TtsPostParametersAccept": { "type": "string", "enum": [ @@ -2464,7 +2656,8 @@ "BearerAuth": { "type": "apiKey", "in": "header", - "name": "Authorization" + "name": "Authorization", + "description": "API key authentication. Include your key as `Authorization: Bearer YOUR_API_KEY`. Access tokens are not accepted on this endpoint." } } }