diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountEmailValues.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountEmailValues.g.cs new file mode 100644 index 00000000..14778aeb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountEmailValues.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_AccountEmailValuesSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_AccountEmailValuesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_AccountEmailValuesSecurityRequirement0, + }; + partial void PrepareAccountEmailValuesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareAccountEmailValuesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessAccountEmailValuesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAccountEmailValuesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Account Email Values + /// + /// + /// 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 AccountEmailValuesAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountEmailValuesAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Account Email Values + /// + /// + /// 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> AccountEmailValuesAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAccountEmailValuesArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AccountEmailValuesSecurityRequirements, + operationName: "AccountEmailValuesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me/emails", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAccountEmailValuesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountEmailValues", + methodName: "AccountEmailValuesAsync", + pathTemplate: "\"/v1/me/emails\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountEmailValues", + methodName: "AccountEmailValuesAsync", + pathTemplate: "\"/v1/me/emails\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountEmailValues", + methodName: "AccountEmailValuesAsync", + pathTemplate: "\"/v1/me/emails\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessAccountEmailValuesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountEmailValues", + methodName: "AccountEmailValuesAsync", + pathTemplate: "\"/v1/me/emails\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountEmailValues", + methodName: "AccountEmailValuesAsync", + pathTemplate: "\"/v1/me/emails\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessAccountEmailValuesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.EmailsOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.EmailsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountGpuLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountGpuLimit.g.cs new file mode 100644 index 00000000..ca95c048 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountGpuLimit.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_AccountGpuLimitSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_AccountGpuLimitSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_AccountGpuLimitSecurityRequirement0, + }; + partial void PrepareAccountGpuLimitArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareAccountGpuLimitRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessAccountGpuLimitResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAccountGpuLimitResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Account Gpu Limit + /// + /// + /// 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 AccountGpuLimitAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountGpuLimitAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Account Gpu Limit + /// + /// + /// 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> AccountGpuLimitAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAccountGpuLimitArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AccountGpuLimitSecurityRequirements, + operationName: "AccountGpuLimitAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me/gpu_limit", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAccountGpuLimitRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGpuLimit", + methodName: "AccountGpuLimitAsync", + pathTemplate: "\"/v1/me/gpu_limit\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGpuLimit", + methodName: "AccountGpuLimitAsync", + pathTemplate: "\"/v1/me/gpu_limit\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGpuLimit", + methodName: "AccountGpuLimitAsync", + pathTemplate: "\"/v1/me/gpu_limit\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessAccountGpuLimitResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGpuLimit", + methodName: "AccountGpuLimitAsync", + pathTemplate: "\"/v1/me/gpu_limit\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGpuLimit", + methodName: "AccountGpuLimitAsync", + pathTemplate: "\"/v1/me/gpu_limit\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessAccountGpuLimitResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.GpuLimitOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.GpuLimitOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountRateLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountRateLimit.g.cs new file mode 100644 index 00000000..bdb6b8e3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountRateLimit.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_AccountRateLimitSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_AccountRateLimitSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_AccountRateLimitSecurityRequirement0, + }; + partial void PrepareAccountRateLimitArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareAccountRateLimitRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessAccountRateLimitResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAccountRateLimitResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Account Rate Limit + /// + /// + /// 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 AccountRateLimitAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountRateLimitAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Account Rate Limit + /// + /// + /// 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> AccountRateLimitAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAccountRateLimitArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AccountRateLimitSecurityRequirements, + operationName: "AccountRateLimitAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me/rate_limit", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAccountRateLimitRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountRateLimit", + methodName: "AccountRateLimitAsync", + pathTemplate: "\"/v1/me/rate_limit\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountRateLimit", + methodName: "AccountRateLimitAsync", + pathTemplate: "\"/v1/me/rate_limit\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountRateLimit", + methodName: "AccountRateLimitAsync", + pathTemplate: "\"/v1/me/rate_limit\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessAccountRateLimitResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountRateLimit", + methodName: "AccountRateLimitAsync", + pathTemplate: "\"/v1/me/rate_limit\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountRateLimit", + methodName: "AccountRateLimitAsync", + pathTemplate: "\"/v1/me/rate_limit\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessAccountRateLimitResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.RateLimitOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.RateLimitOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountUpdateDetails.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountUpdateDetails.g.cs new file mode 100644 index 00000000..db60cd01 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountUpdateDetails.g.cs @@ -0,0 +1,645 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_AccountUpdateDetailsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_AccountUpdateDetailsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_AccountUpdateDetailsSecurityRequirement0, + }; + partial void PrepareAccountUpdateDetailsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.MeIn request); + partial void PrepareAccountUpdateDetailsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.MeIn request); + partial void ProcessAccountUpdateDetailsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAccountUpdateDetailsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Account Update Details + /// + /// + /// + /// 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 AccountUpdateDetailsAsync( + + global::DeepInfra.MeIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountUpdateDetailsAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Account Update Details + /// + /// + /// + /// 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> AccountUpdateDetailsAsResponseAsync( + + global::DeepInfra.MeIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAccountUpdateDetailsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AccountUpdateDetailsSecurityRequirements, + operationName: "AccountUpdateDetailsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAccountUpdateDetailsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountUpdateDetails", + methodName: "AccountUpdateDetailsAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountUpdateDetails", + methodName: "AccountUpdateDetailsAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountUpdateDetails", + methodName: "AccountUpdateDetailsAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "PATCH", + 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::DeepInfra.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); + ProcessAccountUpdateDetailsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountUpdateDetails", + methodName: "AccountUpdateDetailsAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountUpdateDetails", + methodName: "AccountUpdateDetailsAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "PATCH", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unprocessable Entity + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.DeepError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessAccountUpdateDetailsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Account Update Details + /// + /// + /// + /// Personal name + /// + /// + /// First name of the user + /// + /// + /// Last name of the user + /// + /// + /// Country of the user + /// + /// + /// + /// + /// Company name + /// + /// + /// Company website address + /// + /// + /// Job title of the user, e.g. 'Software Engineer' + /// + /// + /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. + /// + /// + /// Short description of the use case for the account + /// + /// + /// Short description of how the user found out about DeepInfra + /// + /// + /// Set to false to opt out of marketing emails + /// + /// + /// ISO 3166-1 alpha-2 country code of the user selected country + /// + /// 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 AccountUpdateDetailsAsync( + string? xiApiKey = default, + string? name = default, + string? firstName = default, + string? lastName = default, + string? country = default, + string? email = default, + bool? isBusinessAccount = default, + string? company = default, + string? website = default, + string? title = default, + string? displayName = default, + string? useCase = default, + string? attribution = default, + bool? marketingEmails = default, + string? countryCode = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.MeIn + { + Name = name, + FirstName = firstName, + LastName = lastName, + Country = country, + Email = email, + IsBusinessAccount = isBusinessAccount, + Company = company, + Website = website, + Title = title, + DisplayName = displayName, + UseCase = useCase, + Attribution = attribution, + MarketingEmails = marketingEmails, + CountryCode = countryCode, + }; + + return await AccountUpdateDetailsAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.DeleteAccount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.DeleteAccount.g.cs new file mode 100644 index 00000000..028e256c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.DeleteAccount.g.cs @@ -0,0 +1,467 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeleteAccountSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeleteAccountSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeleteAccountSecurityRequirement0, + }; + partial void PrepareDeleteAccountArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareDeleteAccountRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessDeleteAccountResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteAccountResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Account + /// + /// + /// 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 DeleteAccountAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteAccountAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Account + /// + /// + /// 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> DeleteAccountAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteAccountArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteAccountSecurityRequirements, + operationName: "DeleteAccountAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteAccountRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAccount", + methodName: "DeleteAccountAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAccount", + methodName: "DeleteAccountAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAccount", + methodName: "DeleteAccountAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "DELETE", + 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::DeepInfra.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); + ProcessDeleteAccountResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAccount", + methodName: "DeleteAccountAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteAccount", + methodName: "DeleteAccountAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "DELETE", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeleteAccountResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.Me.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.Me.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.Me.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.Me.g.cs new file mode 100644 index 00000000..994f0f9b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.Me.g.cs @@ -0,0 +1,483 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_MeSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_MeSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_MeSecurityRequirement0, + }; + partial void PrepareMeArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? checklist, + ref string? xiApiKey); + partial void PrepareMeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? checklist, + string? xiApiKey); + partial void ProcessMeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessMeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Me + /// + /// + /// Default Value: false + /// + /// + /// 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 MeAsync( + bool? checklist = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MeAsResponseAsync( + checklist: checklist, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Me + /// + /// + /// Default Value: false + /// + /// + /// 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> MeAsResponseAsync( + bool? checklist = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareMeArguments( + httpClient: HttpClient, + checklist: ref checklist, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_MeSecurityRequirements, + operationName: "MeAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("checklist", checklist?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareMeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + checklist: checklist, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Me", + methodName: "MeAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Me", + methodName: "MeAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Me", + methodName: "MeAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessMeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Me", + methodName: "MeAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Me", + methodName: "MeAsync", + pathTemplate: "\"/v1/me\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessMeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.Me.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.Me.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestGpuLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestGpuLimitIncrease.g.cs new file mode 100644 index 00000000..a808aa84 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestGpuLimitIncrease.g.cs @@ -0,0 +1,588 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_RequestGpuLimitIncreaseSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_RequestGpuLimitIncreaseSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_RequestGpuLimitIncreaseSecurityRequirement0, + }; + partial void PrepareRequestGpuLimitIncreaseArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.GpuLimitRequestIn request); + partial void PrepareRequestGpuLimitIncreaseRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.GpuLimitRequestIn request); + partial void ProcessRequestGpuLimitIncreaseResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRequestGpuLimitIncreaseResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// 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 RequestGpuLimitIncreaseAsync( + + global::DeepInfra.GpuLimitRequestIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RequestGpuLimitIncreaseAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// 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> RequestGpuLimitIncreaseAsResponseAsync( + + global::DeepInfra.GpuLimitRequestIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareRequestGpuLimitIncreaseArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RequestGpuLimitIncreaseSecurityRequirements, + operationName: "RequestGpuLimitIncreaseAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me/gpu_limit/request", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRequestGpuLimitIncreaseRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestGpuLimitIncrease", + methodName: "RequestGpuLimitIncreaseAsync", + pathTemplate: "\"/v1/me/gpu_limit/request\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestGpuLimitIncrease", + methodName: "RequestGpuLimitIncreaseAsync", + pathTemplate: "\"/v1/me/gpu_limit/request\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestGpuLimitIncrease", + methodName: "RequestGpuLimitIncreaseAsync", + pathTemplate: "\"/v1/me/gpu_limit/request\"", + 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::DeepInfra.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); + ProcessRequestGpuLimitIncreaseResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestGpuLimitIncrease", + methodName: "RequestGpuLimitIncreaseAsync", + pathTemplate: "\"/v1/me/gpu_limit/request\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestGpuLimitIncrease", + methodName: "RequestGpuLimitIncreaseAsync", + pathTemplate: "\"/v1/me/gpu_limit/request\"", + 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); + } + // Forbidden + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::DeepInfra.DeepError? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessRequestGpuLimitIncreaseResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// + /// + /// 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 RequestGpuLimitIncreaseAsync( + string gpuType, + int requestedLimit, + string reason, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.GpuLimitRequestIn + { + GpuType = gpuType, + RequestedLimit = requestedLimit, + Reason = reason, + }; + + return await RequestGpuLimitIncreaseAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestRateLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestRateLimitIncrease.g.cs new file mode 100644 index 00000000..12671f31 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestRateLimitIncrease.g.cs @@ -0,0 +1,588 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_RequestRateLimitIncreaseSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_RequestRateLimitIncreaseSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_RequestRateLimitIncreaseSecurityRequirement0, + }; + partial void PrepareRequestRateLimitIncreaseArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.RateLimitRequestIn request); + partial void PrepareRequestRateLimitIncreaseRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.RateLimitRequestIn request); + partial void ProcessRequestRateLimitIncreaseResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRequestRateLimitIncreaseResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Request Rate Limit Increase + /// + /// + /// + /// 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 RequestRateLimitIncreaseAsync( + + global::DeepInfra.RateLimitRequestIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RequestRateLimitIncreaseAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Request Rate Limit Increase + /// + /// + /// + /// 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> RequestRateLimitIncreaseAsResponseAsync( + + global::DeepInfra.RateLimitRequestIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareRequestRateLimitIncreaseArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RequestRateLimitIncreaseSecurityRequirements, + operationName: "RequestRateLimitIncreaseAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me/rate_limit/request", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRequestRateLimitIncreaseRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestRateLimitIncrease", + methodName: "RequestRateLimitIncreaseAsync", + pathTemplate: "\"/v1/me/rate_limit/request\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestRateLimitIncrease", + methodName: "RequestRateLimitIncreaseAsync", + pathTemplate: "\"/v1/me/rate_limit/request\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestRateLimitIncrease", + methodName: "RequestRateLimitIncreaseAsync", + pathTemplate: "\"/v1/me/rate_limit/request\"", + 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::DeepInfra.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); + ProcessRequestRateLimitIncreaseResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestRateLimitIncrease", + methodName: "RequestRateLimitIncreaseAsync", + pathTemplate: "\"/v1/me/rate_limit/request\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestRateLimitIncrease", + methodName: "RequestRateLimitIncreaseAsync", + pathTemplate: "\"/v1/me/rate_limit/request\"", + 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); + } + // Forbidden + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::DeepInfra.DeepError? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessRequestRateLimitIncreaseResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Request Rate Limit Increase + /// + /// + /// + /// + /// + /// 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 RequestRateLimitIncreaseAsync( + int rateLimit, + string reason, + string? xiApiKey = default, + int? tpmRateLimit = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.RateLimitRequestIn + { + RateLimit = rateLimit, + TpmRateLimit = tpmRateLimit, + Reason = reason, + }; + + return await RequestRateLimitIncreaseAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.TeamSetDisplayName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.TeamSetDisplayName.g.cs new file mode 100644 index 00000000..d74be8d0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.TeamSetDisplayName.g.cs @@ -0,0 +1,584 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_TeamSetDisplayNameSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_TeamSetDisplayNameSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_TeamSetDisplayNameSecurityRequirement0, + }; + partial void PrepareTeamSetDisplayNameArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.DisplayNameIn request); + partial void PrepareTeamSetDisplayNameRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.DisplayNameIn request); + partial void ProcessTeamSetDisplayNameResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessTeamSetDisplayNameResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Team Set Display Name + /// + /// + /// + /// 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 TeamSetDisplayNameAsync( + + global::DeepInfra.DisplayNameIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TeamSetDisplayNameAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Team Set Display Name + /// + /// + /// + /// 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> TeamSetDisplayNameAsResponseAsync( + + global::DeepInfra.DisplayNameIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareTeamSetDisplayNameArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_TeamSetDisplayNameSecurityRequirements, + operationName: "TeamSetDisplayNameAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me/team_display_name", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareTeamSetDisplayNameRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TeamSetDisplayName", + methodName: "TeamSetDisplayNameAsync", + pathTemplate: "\"/v1/me/team_display_name\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TeamSetDisplayName", + methodName: "TeamSetDisplayNameAsync", + pathTemplate: "\"/v1/me/team_display_name\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TeamSetDisplayName", + methodName: "TeamSetDisplayNameAsync", + pathTemplate: "\"/v1/me/team_display_name\"", + 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::DeepInfra.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); + ProcessTeamSetDisplayNameResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TeamSetDisplayName", + methodName: "TeamSetDisplayNameAsync", + pathTemplate: "\"/v1/me/team_display_name\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TeamSetDisplayName", + methodName: "TeamSetDisplayNameAsync", + pathTemplate: "\"/v1/me/team_display_name\"", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessTeamSetDisplayNameResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Team Set Display Name + /// + /// + /// + /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. + /// + /// 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 TeamSetDisplayNameAsync( + string displayName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.DisplayNameIn + { + DisplayName = displayName, + }; + + return await TeamSetDisplayNameAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.g.cs new file mode 100644 index 00000000..ae7caaa8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// User profile, team management, and rate limits.
+ /// 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 AccountClient : global::DeepInfra.IAccountClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AccountClient. + /// 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 AccountClient( + 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 AccountClient 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 AccountClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AccountClient. + /// 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 AccountClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCatalog.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCatalog.g.cs new file mode 100644 index 00000000..9836709f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCatalog.g.cs @@ -0,0 +1,541 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawCatalogSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawCatalogSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawCatalogSecurityRequirement0, + }; + partial void PrepareOpenclawCatalogArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareOpenclawCatalogRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessOpenclawCatalogResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawCatalogResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Catalog + /// + /// + /// 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> OpenclawCatalogAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawCatalogAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Catalog + /// + /// + /// 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>> OpenclawCatalogAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawCatalogArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawCatalogSecurityRequirements, + operationName: "OpenclawCatalogAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/agents/catalog", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawCatalogRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCatalog", + methodName: "OpenclawCatalogAsync", + pathTemplate: "\"/v1/agents/catalog\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCatalog", + methodName: "OpenclawCatalogAsync", + pathTemplate: "\"/v1/agents/catalog\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCatalog", + methodName: "OpenclawCatalogAsync", + pathTemplate: "\"/v1/agents/catalog\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessOpenclawCatalogResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCatalog", + methodName: "OpenclawCatalogAsync", + pathTemplate: "\"/v1/agents/catalog\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCatalog", + methodName: "OpenclawCatalogAsync", + pathTemplate: "\"/v1/agents/catalog\"", + httpMethod: "GET", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawCatalogResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.Dictionary?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.Dictionary?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCreate.g.cs new file mode 100644 index 00000000..ec29c046 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCreate.g.cs @@ -0,0 +1,711 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawCreateSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawCreateSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawCreateSecurityRequirement0, + }; + partial void PrepareOpenclawCreateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.OpenClawCreateIn request); + partial void PrepareOpenclawCreateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.OpenClawCreateIn request); + partial void ProcessOpenclawCreateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawCreateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Create + /// + /// + /// + /// 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 OpenclawCreateAsync( + + global::DeepInfra.OpenClawCreateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawCreateAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Create + /// + /// + /// + /// 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> OpenclawCreateAsResponseAsync( + + global::DeepInfra.OpenClawCreateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenclawCreateArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawCreateSecurityRequirements, + operationName: "OpenclawCreateAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/agents", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawCreateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCreate", + methodName: "OpenclawCreateAsync", + pathTemplate: "\"/v1/agents\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCreate", + methodName: "OpenclawCreateAsync", + pathTemplate: "\"/v1/agents\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCreate", + methodName: "OpenclawCreateAsync", + pathTemplate: "\"/v1/agents\"", + 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::DeepInfra.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); + ProcessOpenclawCreateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCreate", + methodName: "OpenclawCreateAsync", + pathTemplate: "\"/v1/agents\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCreate", + methodName: "OpenclawCreateAsync", + pathTemplate: "\"/v1/agents\"", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Payment Required + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::DeepInfra.DeepError? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::DeepInfra.DeepError.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::DeepInfra.DeepError.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too Many Requests + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::DeepInfra.DeepError? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::DeepInfra.DeepError.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::DeepInfra.DeepError.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Service Unavailable + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::DeepInfra.DeepError? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::DeepInfra.DeepError.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::DeepInfra.DeepError.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawCreateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenClawCreateOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenClawCreateOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Openclaw Create + /// + /// + /// + /// Instance name + /// + /// + /// Agent type identifier
+ /// Default Value: openclaw + /// + /// + /// Plan identifier
+ /// Default Value: standard + /// + /// 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 OpenclawCreateAsync( + string name, + string? xiApiKey = default, + string? agentTypeId = default, + string? planId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenClawCreateIn + { + Name = name, + AgentTypeId = agentTypeId, + PlanId = planId, + }; + + return await OpenclawCreateAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawDelete.g.cs new file mode 100644 index 00000000..842f12d2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawDelete.g.cs @@ -0,0 +1,546 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawDeleteSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawDeleteSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawDeleteSecurityRequirement0, + }; + partial void PrepareOpenclawDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey); + partial void PrepareOpenclawDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey); + partial void ProcessOpenclawDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawDeleteResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Delete + /// + /// + /// + /// 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 OpenclawDeleteAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawDeleteAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Delete + /// + /// + /// + /// 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> OpenclawDeleteAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawDeleteArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawDeleteSecurityRequirements, + operationName: "OpenclawDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawDelete", + methodName: "OpenclawDeleteAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawDelete", + methodName: "OpenclawDeleteAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawDelete", + methodName: "OpenclawDeleteAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "DELETE", + 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::DeepInfra.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); + ProcessOpenclawDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawDelete", + methodName: "OpenclawDeleteAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawDelete", + methodName: "OpenclawDeleteAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "DELETE", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawGet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawGet.g.cs new file mode 100644 index 00000000..736d0e6e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawGet.g.cs @@ -0,0 +1,550 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawGetSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawGetSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawGetSecurityRequirement0, + }; + partial void PrepareOpenclawGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey); + partial void PrepareOpenclawGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey); + partial void ProcessOpenclawGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Get + /// + /// + /// + /// 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 OpenclawGetAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawGetAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Get + /// + /// + /// + /// 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> OpenclawGetAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawGetArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawGetSecurityRequirements, + operationName: "OpenclawGetAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawGet", + methodName: "OpenclawGetAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawGet", + methodName: "OpenclawGetAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawGet", + methodName: "OpenclawGetAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessOpenclawGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawGet", + methodName: "OpenclawGetAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawGet", + methodName: "OpenclawGetAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "GET", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenClawInstanceOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenClawInstanceOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawLaunchToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawLaunchToken.g.cs new file mode 100644 index 00000000..351f7565 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawLaunchToken.g.cs @@ -0,0 +1,605 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawLaunchTokenSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawLaunchTokenSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawLaunchTokenSecurityRequirement0, + }; + partial void PrepareOpenclawLaunchTokenArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey); + partial void PrepareOpenclawLaunchTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey); + partial void ProcessOpenclawLaunchTokenResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawLaunchTokenResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Launch Token
+ /// Mint a single-use launch URL for the dashboard.
+ /// Called by the launcher page right when readyz flips ready. The launch URL
+ /// is used as a top-level navigation; /launch then sets the oc_auth cookie
+ /// and 302s into the proxied dashboard.
+ /// The user's bearer token is stashed in Redis under the token's jti and
+ /// retrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of
+ /// the URL and out of any signed payload while preserving the existing proxy
+ /// auth flow (oc_auth cookie value = bearer token).
+ /// Refuses instances whose agent_type has has_dashboard=False (e.g. hermes). + ///
+ /// + /// + /// 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 OpenclawLaunchTokenAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawLaunchTokenAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Launch Token
+ /// Mint a single-use launch URL for the dashboard.
+ /// Called by the launcher page right when readyz flips ready. The launch URL
+ /// is used as a top-level navigation; /launch then sets the oc_auth cookie
+ /// and 302s into the proxied dashboard.
+ /// The user's bearer token is stashed in Redis under the token's jti and
+ /// retrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of
+ /// the URL and out of any signed payload while preserving the existing proxy
+ /// auth flow (oc_auth cookie value = bearer token).
+ /// Refuses instances whose agent_type has has_dashboard=False (e.g. hermes). + ///
+ /// + /// + /// 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> OpenclawLaunchTokenAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawLaunchTokenArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawLaunchTokenSecurityRequirements, + operationName: "OpenclawLaunchTokenAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/launch_token", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawLaunchTokenRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawLaunchToken", + methodName: "OpenclawLaunchTokenAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/launch_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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawLaunchToken", + methodName: "OpenclawLaunchTokenAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/launch_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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawLaunchToken", + methodName: "OpenclawLaunchTokenAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/launch_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::DeepInfra.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); + ProcessOpenclawLaunchTokenResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawLaunchToken", + methodName: "OpenclawLaunchTokenAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/launch_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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawLaunchToken", + methodName: "OpenclawLaunchTokenAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/launch_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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawLaunchTokenResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenClawLaunchTokenOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenClawLaunchTokenOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawList.g.cs new file mode 100644 index 00000000..1d530086 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawList.g.cs @@ -0,0 +1,522 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawListSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawListSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawListSecurityRequirement0, + }; + partial void PrepareOpenclawListArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::DeepInfra.OpenclawListV1AgentsGetState? state, + ref string? xiApiKey); + partial void PrepareOpenclawListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::DeepInfra.OpenclawListV1AgentsGetState? state, + string? xiApiKey); + partial void ProcessOpenclawListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw List + /// + /// + /// Which instances to return: active, inactive, or all (both)
+ /// Default Value: active + /// + /// + /// 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> OpenclawListAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawListAsResponseAsync( + state: state, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw List + /// + /// + /// Which instances to return: active, inactive, or all (both)
+ /// Default Value: active + /// + /// + /// 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>> OpenclawListAsResponseAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawListArguments( + httpClient: HttpClient, + state: ref state, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawListSecurityRequirements, + operationName: "OpenclawListAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/agents", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("state", state?.ToValueString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + state: state, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawList", + methodName: "OpenclawListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawList", + methodName: "OpenclawListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawList", + methodName: "OpenclawListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessOpenclawListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawList", + methodName: "OpenclawListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawList", + methodName: "OpenclawListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawListBackups.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawListBackups.g.cs new file mode 100644 index 00000000..f100564e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawListBackups.g.cs @@ -0,0 +1,550 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawListBackupsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawListBackupsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawListBackupsSecurityRequirement0, + }; + partial void PrepareOpenclawListBackupsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey); + partial void PrepareOpenclawListBackupsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey); + partial void ProcessOpenclawListBackupsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawListBackupsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw List Backups + /// + /// + /// + /// 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> OpenclawListBackupsAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawListBackupsAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw List Backups + /// + /// + /// + /// 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>> OpenclawListBackupsAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawListBackupsArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawListBackupsSecurityRequirements, + operationName: "OpenclawListBackupsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/backups", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawListBackupsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawListBackups", + methodName: "OpenclawListBackupsAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawListBackups", + methodName: "OpenclawListBackupsAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawListBackups", + methodName: "OpenclawListBackupsAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessOpenclawListBackupsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawListBackups", + methodName: "OpenclawListBackupsAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawListBackups", + methodName: "OpenclawListBackupsAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups\"", + httpMethod: "GET", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawListBackupsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawRestoreBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawRestoreBackup.g.cs new file mode 100644 index 00000000..72e9f035 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawRestoreBackup.g.cs @@ -0,0 +1,592 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawRestoreBackupSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawRestoreBackupSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawRestoreBackupSecurityRequirement0, + }; + partial void PrepareOpenclawRestoreBackupArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string backupId, + ref string? xiApiKey); + partial void PrepareOpenclawRestoreBackupRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string backupId, + string? xiApiKey); + partial void ProcessOpenclawRestoreBackupResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawRestoreBackupResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Restore Backup + /// + /// + /// + /// + /// 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 OpenclawRestoreBackupAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawRestoreBackupAsResponseAsync( + instanceId: instanceId, + backupId: backupId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Restore Backup + /// + /// + /// + /// + /// 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> OpenclawRestoreBackupAsResponseAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawRestoreBackupArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + backupId: ref backupId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawRestoreBackupSecurityRequirements, + operationName: "OpenclawRestoreBackupAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/backups/{backupId}/restore", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawRestoreBackupRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + backupId: backupId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawRestoreBackup", + methodName: "OpenclawRestoreBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups/{backupId}/restore\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawRestoreBackup", + methodName: "OpenclawRestoreBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups/{backupId}/restore\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawRestoreBackup", + methodName: "OpenclawRestoreBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups/{backupId}/restore\"", + 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::DeepInfra.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); + ProcessOpenclawRestoreBackupResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawRestoreBackup", + methodName: "OpenclawRestoreBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups/{backupId}/restore\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawRestoreBackup", + methodName: "OpenclawRestoreBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups/{backupId}/restore\"", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawRestoreBackupResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStart.g.cs new file mode 100644 index 00000000..f8fdb08f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStart.g.cs @@ -0,0 +1,583 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawStartSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawStartSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawStartSecurityRequirement0, + }; + partial void PrepareOpenclawStartArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey); + partial void PrepareOpenclawStartRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey); + partial void ProcessOpenclawStartResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawStartResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Start + /// + /// + /// + /// 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 OpenclawStartAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawStartAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Start + /// + /// + /// + /// 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> OpenclawStartAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawStartArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawStartSecurityRequirements, + operationName: "OpenclawStartAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/start", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawStartRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStart", + methodName: "OpenclawStartAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/start\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStart", + methodName: "OpenclawStartAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/start\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStart", + methodName: "OpenclawStartAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/start\"", + 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::DeepInfra.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); + ProcessOpenclawStartResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStart", + methodName: "OpenclawStartAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/start\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStart", + methodName: "OpenclawStartAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/start\"", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawStartResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStop.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStop.g.cs new file mode 100644 index 00000000..b469cee6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStop.g.cs @@ -0,0 +1,583 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawStopSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawStopSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawStopSecurityRequirement0, + }; + partial void PrepareOpenclawStopArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey); + partial void PrepareOpenclawStopRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey); + partial void ProcessOpenclawStopResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawStopResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Stop + /// + /// + /// + /// 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 OpenclawStopAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawStopAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Stop + /// + /// + /// + /// 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> OpenclawStopAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawStopArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawStopSecurityRequirements, + operationName: "OpenclawStopAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/stop", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawStopRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStop", + methodName: "OpenclawStopAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/stop\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStop", + methodName: "OpenclawStopAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/stop\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStop", + methodName: "OpenclawStopAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/stop\"", + 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::DeepInfra.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); + ProcessOpenclawStopResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStop", + methodName: "OpenclawStopAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/stop\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStop", + methodName: "OpenclawStopAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/stop\"", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawStopResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawTriggerBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawTriggerBackup.g.cs new file mode 100644 index 00000000..80e8dffd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawTriggerBackup.g.cs @@ -0,0 +1,583 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawTriggerBackupSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawTriggerBackupSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawTriggerBackupSecurityRequirement0, + }; + partial void PrepareOpenclawTriggerBackupArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey); + partial void PrepareOpenclawTriggerBackupRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey); + partial void ProcessOpenclawTriggerBackupResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawTriggerBackupResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Trigger Backup + /// + /// + /// + /// 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 OpenclawTriggerBackupAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawTriggerBackupAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Trigger Backup + /// + /// + /// + /// 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> OpenclawTriggerBackupAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawTriggerBackupArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawTriggerBackupSecurityRequirements, + operationName: "OpenclawTriggerBackupAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/backup", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawTriggerBackupRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawTriggerBackup", + methodName: "OpenclawTriggerBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backup\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawTriggerBackup", + methodName: "OpenclawTriggerBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backup\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawTriggerBackup", + methodName: "OpenclawTriggerBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backup\"", + 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::DeepInfra.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); + ProcessOpenclawTriggerBackupResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawTriggerBackup", + methodName: "OpenclawTriggerBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backup\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawTriggerBackup", + methodName: "OpenclawTriggerBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backup\"", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawTriggerBackupResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdate.g.cs new file mode 100644 index 00000000..7dc9eee0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdate.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawUpdateSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawUpdateSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawUpdateSecurityRequirement0, + }; + partial void PrepareOpenclawUpdateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + global::DeepInfra.OpenClawUpdateIn request); + partial void PrepareOpenclawUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + global::DeepInfra.OpenClawUpdateIn request); + partial void ProcessOpenclawUpdateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawUpdateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Update + /// + /// + /// + /// + /// 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 OpenclawUpdateAsync( + string instanceId, + + global::DeepInfra.OpenClawUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawUpdateAsResponseAsync( + instanceId: instanceId, + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Update + /// + /// + /// + /// + /// 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> OpenclawUpdateAsResponseAsync( + string instanceId, + + global::DeepInfra.OpenClawUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenclawUpdateArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawUpdateSecurityRequirements, + operationName: "OpenclawUpdateAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdate", + methodName: "OpenclawUpdateAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdate", + methodName: "OpenclawUpdateAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdate", + methodName: "OpenclawUpdateAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "PATCH", + 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::DeepInfra.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); + ProcessOpenclawUpdateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdate", + methodName: "OpenclawUpdateAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdate", + methodName: "OpenclawUpdateAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "PATCH", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawUpdateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Openclaw Update + /// + /// + /// + /// + /// Instance name + /// + /// 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 OpenclawUpdateAsync( + string instanceId, + string name, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenClawUpdateIn + { + Name = name, + }; + + return await OpenclawUpdateAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdateVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdateVersion.g.cs new file mode 100644 index 00000000..b6b11551 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdateVersion.g.cs @@ -0,0 +1,583 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawUpdateVersionSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawUpdateVersionSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawUpdateVersionSecurityRequirement0, + }; + partial void PrepareOpenclawUpdateVersionArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey); + partial void PrepareOpenclawUpdateVersionRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey); + partial void ProcessOpenclawUpdateVersionResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawUpdateVersionResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Update Version + /// + /// + /// + /// 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 OpenclawUpdateVersionAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawUpdateVersionAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Update Version + /// + /// + /// + /// 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> OpenclawUpdateVersionAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawUpdateVersionArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawUpdateVersionSecurityRequirements, + operationName: "OpenclawUpdateVersionAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/update", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenclawUpdateVersionRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdateVersion", + methodName: "OpenclawUpdateVersionAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/update\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdateVersion", + methodName: "OpenclawUpdateVersionAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/update\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdateVersion", + methodName: "OpenclawUpdateVersionAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/update\"", + 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::DeepInfra.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); + ProcessOpenclawUpdateVersionResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdateVersion", + methodName: "OpenclawUpdateVersionAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/update\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdateVersion", + methodName: "OpenclawUpdateVersionAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/update\"", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenclawUpdateVersionResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.g.cs new file mode 100644 index 00000000..7c91548b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Manage agent-framework instances (OpenClaw and friends).
+ /// 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 AgentsClient : global::DeepInfra.IAgentsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AgentsClient. + /// 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 AgentsClient( + 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 AgentsClient 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 AgentsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AgentsClient. + /// 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 AgentsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.AnyOf.2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.g.cs index d8950855..3f4a7e9b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.g.cs @@ -25,6 +25,26 @@ namespace DeepInfra #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -41,6 +61,26 @@ namespace DeepInfra [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] #endif public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); /// /// /// @@ -59,6 +99,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -77,6 +122,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -143,6 +193,30 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, bool validate = true) { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.g.cs index 1b628e9c..2ce7efb8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.g.cs @@ -25,6 +25,26 @@ namespace DeepInfra #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -42,6 +62,26 @@ namespace DeepInfra #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// /// /// @@ -58,6 +98,26 @@ namespace DeepInfra [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] #endif public bool IsValue3 => Value3 != null; + + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); /// /// /// @@ -76,6 +136,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -94,6 +159,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -112,6 +182,11 @@ public AnyOf(T3? value) Value3 = value; } + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + /// /// /// @@ -187,6 +262,36 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, bool validate = true) diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.g.cs index e3ca5bbd..8cc3f9ec 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.g.cs @@ -25,6 +25,26 @@ namespace DeepInfra #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -42,6 +62,26 @@ namespace DeepInfra #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// /// /// @@ -59,6 +99,26 @@ namespace DeepInfra #endif public bool IsValue3 => Value3 != null; + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + /// /// /// @@ -75,6 +135,26 @@ namespace DeepInfra [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] #endif public bool IsValue4 => Value4 != null; + + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } + + /// + /// + /// + public T4 PickValue4() => IsValue4 + ? Value4! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); /// /// /// @@ -93,6 +173,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -111,6 +196,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -129,6 +219,11 @@ public AnyOf(T3? value) Value3 = value; } + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + /// /// /// @@ -147,6 +242,11 @@ public AnyOf(T4? value) Value4 = value; } + /// + /// + /// + public static AnyOf FromValue4(T4? value) => new AnyOf(value); + /// /// /// @@ -231,6 +331,42 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null, diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.g.cs index 77f3bd98..b780455c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.g.cs @@ -25,6 +25,26 @@ namespace DeepInfra #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -42,6 +62,26 @@ namespace DeepInfra #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// /// /// @@ -59,6 +99,26 @@ namespace DeepInfra #endif public bool IsValue3 => Value3 != null; + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + /// /// /// @@ -76,6 +136,26 @@ namespace DeepInfra #endif public bool IsValue4 => Value4 != null; + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } + + /// + /// + /// + public T4 PickValue4() => IsValue4 + ? Value4! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); + /// /// /// @@ -92,6 +172,26 @@ namespace DeepInfra [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] #endif public bool IsValue5 => Value5 != null; + + /// + /// + /// + public bool TryPickValue5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T5? value) + { + value = Value5; + return IsValue5; + } + + /// + /// + /// + public T5 PickValue5() => IsValue5 + ? Value5! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value5' but the value was {ToString()}."); /// /// /// @@ -110,6 +210,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -128,6 +233,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -146,6 +256,11 @@ public AnyOf(T3? value) Value3 = value; } + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + /// /// /// @@ -164,6 +279,11 @@ public AnyOf(T4? value) Value4 = value; } + /// + /// + /// + public static AnyOf FromValue4(T4? value) => new AnyOf(value); + /// /// /// @@ -182,6 +302,11 @@ public AnyOf(T5? value) Value5 = value; } + /// + /// + /// + public static AnyOf FromValue5(T5? value) => new AnyOf(value); + /// /// /// @@ -275,6 +400,48 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + + global::System.Action? value5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null, diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.Json.g.cs deleted file mode 100644 index 3d365af6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public readonly partial struct AnyOf - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.AnyOf? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnyOf), - jsonSerializerContext) as global::DeepInfra.AnyOf?; - } - - /// - /// 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::DeepInfra.AnyOf? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.AnyOf), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnyOf?; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.g.cs deleted file mode 100644 index 57f5215f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.g.cs +++ /dev/null @@ -1,532 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public readonly partial struct AnyOf : global::System.IEquatable> - { - /// - /// - /// -#if NET6_0_OR_GREATER - public T1? Value1 { get; init; } -#else - public T1? Value1 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] -#endif - public bool IsValue1 => Value1 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T2? Value2 { get; init; } -#else - public T2? Value2 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] -#endif - public bool IsValue2 => Value2 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T3? Value3 { get; init; } -#else - public T3? Value3 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] -#endif - public bool IsValue3 => Value3 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T4? Value4 { get; init; } -#else - public T4? Value4 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] -#endif - public bool IsValue4 => Value4 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T5? Value5 { get; init; } -#else - public T5? Value5 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] -#endif - public bool IsValue5 => Value5 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T6? Value6 { get; init; } -#else - public T6? Value6 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value6))] -#endif - public bool IsValue6 => Value6 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T7? Value7 { get; init; } -#else - public T7? Value7 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value7))] -#endif - public bool IsValue7 => Value7 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T8? Value8 { get; init; } -#else - public T8? Value8 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value8))] -#endif - public bool IsValue8 => Value8 != null; - /// - /// - /// - public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); - - /// - /// - /// - public static implicit operator T1?(AnyOf @this) => @this.Value1; - - /// - /// - /// - public AnyOf(T1? value) - { - Value1 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T2 value) => new AnyOf((T2?)value); - - /// - /// - /// - public static implicit operator T2?(AnyOf @this) => @this.Value2; - - /// - /// - /// - public AnyOf(T2? value) - { - Value2 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T3 value) => new AnyOf((T3?)value); - - /// - /// - /// - public static implicit operator T3?(AnyOf @this) => @this.Value3; - - /// - /// - /// - public AnyOf(T3? value) - { - Value3 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T4 value) => new AnyOf((T4?)value); - - /// - /// - /// - public static implicit operator T4?(AnyOf @this) => @this.Value4; - - /// - /// - /// - public AnyOf(T4? value) - { - Value4 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T5 value) => new AnyOf((T5?)value); - - /// - /// - /// - public static implicit operator T5?(AnyOf @this) => @this.Value5; - - /// - /// - /// - public AnyOf(T5? value) - { - Value5 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T6 value) => new AnyOf((T6?)value); - - /// - /// - /// - public static implicit operator T6?(AnyOf @this) => @this.Value6; - - /// - /// - /// - public AnyOf(T6? value) - { - Value6 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T7 value) => new AnyOf((T7?)value); - - /// - /// - /// - public static implicit operator T7?(AnyOf @this) => @this.Value7; - - /// - /// - /// - public AnyOf(T7? value) - { - Value7 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T8 value) => new AnyOf((T8?)value); - - /// - /// - /// - public static implicit operator T8?(AnyOf @this) => @this.Value8; - - /// - /// - /// - public AnyOf(T8? value) - { - Value8 = value; - } - - /// - /// - /// - public AnyOf( - T1? value1, - T2? value2, - T3? value3, - T4? value4, - T5? value5, - T6? value6, - T7? value7, - T8? value8 - ) - { - Value1 = value1; - Value2 = value2; - Value3 = value3; - Value4 = value4; - Value5 = value5; - Value6 = value6; - Value7 = value7; - Value8 = value8; - } - - /// - /// - /// - public object? Object => - Value8 as object ?? - Value7 as object ?? - Value6 as object ?? - Value5 as object ?? - Value4 as object ?? - Value3 as object ?? - Value2 as object ?? - Value1 as object - ; - - /// - /// - /// - public override string? ToString() => - Value1?.ToString() ?? - Value2?.ToString() ?? - Value3?.ToString() ?? - Value4?.ToString() ?? - Value5?.ToString() ?? - Value6?.ToString() ?? - Value7?.ToString() ?? - Value8?.ToString() - ; - - /// - /// - /// - public bool Validate() - { - return IsValue1 || IsValue2 || IsValue3 || IsValue4 || IsValue5 || IsValue6 || IsValue7 || IsValue8; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? value1 = null, - global::System.Func? value2 = null, - global::System.Func? value3 = null, - global::System.Func? value4 = null, - global::System.Func? value5 = null, - global::System.Func? value6 = null, - global::System.Func? value7 = null, - global::System.Func? value8 = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsValue1 && value1 != null) - { - return value1(Value1!); - } - else if (IsValue2 && value2 != null) - { - return value2(Value2!); - } - else if (IsValue3 && value3 != null) - { - return value3(Value3!); - } - else if (IsValue4 && value4 != null) - { - return value4(Value4!); - } - else if (IsValue5 && value5 != null) - { - return value5(Value5!); - } - else if (IsValue6 && value6 != null) - { - return value6(Value6!); - } - else if (IsValue7 && value7 != null) - { - return value7(Value7!); - } - else if (IsValue8 && value8 != null) - { - return value8(Value8!); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? value1 = null, - global::System.Action? value2 = null, - global::System.Action? value3 = null, - global::System.Action? value4 = null, - global::System.Action? value5 = null, - global::System.Action? value6 = null, - global::System.Action? value7 = null, - global::System.Action? value8 = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsValue1) - { - value1?.Invoke(Value1!); - } - else if (IsValue2) - { - value2?.Invoke(Value2!); - } - else if (IsValue3) - { - value3?.Invoke(Value3!); - } - else if (IsValue4) - { - value4?.Invoke(Value4!); - } - else if (IsValue5) - { - value5?.Invoke(Value5!); - } - else if (IsValue6) - { - value6?.Invoke(Value6!); - } - else if (IsValue7) - { - value7?.Invoke(Value7!); - } - else if (IsValue8) - { - value8?.Invoke(Value8!); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - Value1, - typeof(T1), - Value2, - typeof(T2), - Value3, - typeof(T3), - Value4, - typeof(T4), - Value5, - typeof(T5), - Value6, - typeof(T6), - Value7, - typeof(T7), - Value8, - typeof(T8), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(AnyOf other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value5, other.Value5) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value6, other.Value6) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value7, other.Value7) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value8, other.Value8) - ; - } - - /// - /// - /// - public static bool operator ==(AnyOf obj1, AnyOf obj2) - { - return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(AnyOf obj1, AnyOf obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is AnyOf o && Equals(o); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.9.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.9.Json.g.cs new file mode 100644 index 00000000..4b8720d7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.9.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public readonly partial struct AnyOf + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AnyOf? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AnyOf), + jsonSerializerContext) as global::DeepInfra.AnyOf?; + } + + /// + /// 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::DeepInfra.AnyOf? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.AnyOf), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnyOf?; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.9.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.9.g.cs new file mode 100644 index 00000000..71ac55ce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.9.g.cs @@ -0,0 +1,875 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public readonly partial struct AnyOf : global::System.IEquatable> + { + /// + /// + /// +#if NET6_0_OR_GREATER + public T1? Value1 { get; init; } +#else + public T1? Value1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] +#endif + public bool IsValue1 => Value1 != null; + + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T2? Value2 { get; init; } +#else + public T2? Value2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] +#endif + public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T3? Value3 { get; init; } +#else + public T3? Value3 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] +#endif + public bool IsValue3 => Value3 != null; + + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T4? Value4 { get; init; } +#else + public T4? Value4 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] +#endif + public bool IsValue4 => Value4 != null; + + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } + + /// + /// + /// + public T4 PickValue4() => IsValue4 + ? Value4! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T5? Value5 { get; init; } +#else + public T5? Value5 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] +#endif + public bool IsValue5 => Value5 != null; + + /// + /// + /// + public bool TryPickValue5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T5? value) + { + value = Value5; + return IsValue5; + } + + /// + /// + /// + public T5 PickValue5() => IsValue5 + ? Value5! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value5' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T6? Value6 { get; init; } +#else + public T6? Value6 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value6))] +#endif + public bool IsValue6 => Value6 != null; + + /// + /// + /// + public bool TryPickValue6( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T6? value) + { + value = Value6; + return IsValue6; + } + + /// + /// + /// + public T6 PickValue6() => IsValue6 + ? Value6! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value6' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T7? Value7 { get; init; } +#else + public T7? Value7 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value7))] +#endif + public bool IsValue7 => Value7 != null; + + /// + /// + /// + public bool TryPickValue7( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T7? value) + { + value = Value7; + return IsValue7; + } + + /// + /// + /// + public T7 PickValue7() => IsValue7 + ? Value7! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value7' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T8? Value8 { get; init; } +#else + public T8? Value8 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value8))] +#endif + public bool IsValue8 => Value8 != null; + + /// + /// + /// + public bool TryPickValue8( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T8? value) + { + value = Value8; + return IsValue8; + } + + /// + /// + /// + public T8 PickValue8() => IsValue8 + ? Value8! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value8' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T9? Value9 { get; init; } +#else + public T9? Value9 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value9))] +#endif + public bool IsValue9 => Value9 != null; + + /// + /// + /// + public bool TryPickValue9( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T9? value) + { + value = Value9; + return IsValue9; + } + + /// + /// + /// + public T9 PickValue9() => IsValue9 + ? Value9! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value9' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); + + /// + /// + /// + public static implicit operator T1?(AnyOf @this) => @this.Value1; + + /// + /// + /// + public AnyOf(T1? value) + { + Value1 = value; + } + + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T2 value) => new AnyOf((T2?)value); + + /// + /// + /// + public static implicit operator T2?(AnyOf @this) => @this.Value2; + + /// + /// + /// + public AnyOf(T2? value) + { + Value2 = value; + } + + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T3 value) => new AnyOf((T3?)value); + + /// + /// + /// + public static implicit operator T3?(AnyOf @this) => @this.Value3; + + /// + /// + /// + public AnyOf(T3? value) + { + Value3 = value; + } + + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T4 value) => new AnyOf((T4?)value); + + /// + /// + /// + public static implicit operator T4?(AnyOf @this) => @this.Value4; + + /// + /// + /// + public AnyOf(T4? value) + { + Value4 = value; + } + + /// + /// + /// + public static AnyOf FromValue4(T4? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T5 value) => new AnyOf((T5?)value); + + /// + /// + /// + public static implicit operator T5?(AnyOf @this) => @this.Value5; + + /// + /// + /// + public AnyOf(T5? value) + { + Value5 = value; + } + + /// + /// + /// + public static AnyOf FromValue5(T5? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T6 value) => new AnyOf((T6?)value); + + /// + /// + /// + public static implicit operator T6?(AnyOf @this) => @this.Value6; + + /// + /// + /// + public AnyOf(T6? value) + { + Value6 = value; + } + + /// + /// + /// + public static AnyOf FromValue6(T6? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T7 value) => new AnyOf((T7?)value); + + /// + /// + /// + public static implicit operator T7?(AnyOf @this) => @this.Value7; + + /// + /// + /// + public AnyOf(T7? value) + { + Value7 = value; + } + + /// + /// + /// + public static AnyOf FromValue7(T7? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T8 value) => new AnyOf((T8?)value); + + /// + /// + /// + public static implicit operator T8?(AnyOf @this) => @this.Value8; + + /// + /// + /// + public AnyOf(T8? value) + { + Value8 = value; + } + + /// + /// + /// + public static AnyOf FromValue8(T8? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T9 value) => new AnyOf((T9?)value); + + /// + /// + /// + public static implicit operator T9?(AnyOf @this) => @this.Value9; + + /// + /// + /// + public AnyOf(T9? value) + { + Value9 = value; + } + + /// + /// + /// + public static AnyOf FromValue9(T9? value) => new AnyOf(value); + + /// + /// + /// + public AnyOf( + T1? value1, + T2? value2, + T3? value3, + T4? value4, + T5? value5, + T6? value6, + T7? value7, + T8? value8, + T9? value9 + ) + { + Value1 = value1; + Value2 = value2; + Value3 = value3; + Value4 = value4; + Value5 = value5; + Value6 = value6; + Value7 = value7; + Value8 = value8; + Value9 = value9; + } + + /// + /// + /// + public object? Object => + Value9 as object ?? + Value8 as object ?? + Value7 as object ?? + Value6 as object ?? + Value5 as object ?? + Value4 as object ?? + Value3 as object ?? + Value2 as object ?? + Value1 as object + ; + + /// + /// + /// + public override string? ToString() => + Value1?.ToString() ?? + Value2?.ToString() ?? + Value3?.ToString() ?? + Value4?.ToString() ?? + Value5?.ToString() ?? + Value6?.ToString() ?? + Value7?.ToString() ?? + Value8?.ToString() ?? + Value9?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsValue1 || IsValue2 || IsValue3 || IsValue4 || IsValue5 || IsValue6 || IsValue7 || IsValue8 || IsValue9; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + global::System.Func? value3 = null, + global::System.Func? value4 = null, + global::System.Func? value5 = null, + global::System.Func? value6 = null, + global::System.Func? value7 = null, + global::System.Func? value8 = null, + global::System.Func? value9 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + else if (IsValue3 && value3 != null) + { + return value3(Value3!); + } + else if (IsValue4 && value4 != null) + { + return value4(Value4!); + } + else if (IsValue5 && value5 != null) + { + return value5(Value5!); + } + else if (IsValue6 && value6 != null) + { + return value6(Value6!); + } + else if (IsValue7 && value7 != null) + { + return value7(Value7!); + } + else if (IsValue8 && value8 != null) + { + return value8(Value8!); + } + else if (IsValue9 && value9 != null) + { + return value9(Value9!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + + global::System.Action? value5 = null, + + global::System.Action? value6 = null, + + global::System.Action? value7 = null, + + global::System.Action? value8 = null, + + global::System.Action? value9 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + else if (IsValue6) + { + value6?.Invoke(Value6!); + } + else if (IsValue7) + { + value7?.Invoke(Value7!); + } + else if (IsValue8) + { + value8?.Invoke(Value8!); + } + else if (IsValue9) + { + value9?.Invoke(Value9!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + global::System.Action? value3 = null, + global::System.Action? value4 = null, + global::System.Action? value5 = null, + global::System.Action? value6 = null, + global::System.Action? value7 = null, + global::System.Action? value8 = null, + global::System.Action? value9 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + else if (IsValue6) + { + value6?.Invoke(Value6!); + } + else if (IsValue7) + { + value7?.Invoke(Value7!); + } + else if (IsValue8) + { + value8?.Invoke(Value8!); + } + else if (IsValue9) + { + value9?.Invoke(Value9!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Value1, + typeof(T1), + Value2, + typeof(T2), + Value3, + typeof(T3), + Value4, + typeof(T4), + Value5, + typeof(T5), + Value6, + typeof(T6), + Value7, + typeof(T7), + Value8, + typeof(T8), + Value9, + typeof(T9), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(AnyOf other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value5, other.Value5) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value6, other.Value6) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value7, other.Value7) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value8, other.Value8) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value9, other.Value9) + ; + } + + /// + /// + /// + public static bool operator ==(AnyOf obj1, AnyOf obj2) + { + return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(AnyOf obj1, AnyOf obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is AnyOf o && Equals(o); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioSpeech.g.cs new file mode 100644 index 00000000..154e0077 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioSpeech.g.cs @@ -0,0 +1,558 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AudioClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiAudioSpeechSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiAudioSpeechSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiAudioSpeechSecurityRequirement0, + }; + partial void PrepareOpenaiAudioSpeechArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xDeepinfraSource, + ref string? xiApiKey, + global::DeepInfra.OpenAITextToSpeechIn request); + partial void PrepareOpenaiAudioSpeechRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? xiApiKey, + global::DeepInfra.OpenAITextToSpeechIn request); + partial void ProcessOpenaiAudioSpeechResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiAudioSpeechResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Audio Speech + /// + /// + /// + /// + /// 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 OpenaiAudioSpeechAsync( + + global::DeepInfra.OpenAITextToSpeechIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiAudioSpeechAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Audio Speech + /// + /// + /// + /// + /// 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> OpenaiAudioSpeechAsResponseAsync( + + global::DeepInfra.OpenAITextToSpeechIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioSpeechArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiAudioSpeechSecurityRequirements, + operationName: "OpenaiAudioSpeechAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/audio/speech", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioSpeechRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioSpeech", + methodName: "OpenaiAudioSpeechAsync", + pathTemplate: "\"/v1/audio/speech\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioSpeech", + methodName: "OpenaiAudioSpeechAsync", + pathTemplate: "\"/v1/audio/speech\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioSpeech", + methodName: "OpenaiAudioSpeechAsync", + pathTemplate: "\"/v1/audio/speech\"", + 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::DeepInfra.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); + ProcessOpenaiAudioSpeechResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioSpeech", + methodName: "OpenaiAudioSpeechAsync", + pathTemplate: "\"/v1/audio/speech\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioSpeech", + methodName: "OpenaiAudioSpeechAsync", + pathTemplate: "\"/v1/audio/speech\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiAudioSpeechResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Audio Speech + /// + /// + /// + /// + /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// model name + /// + /// + /// Text to convert to speech + /// + /// + /// Preset voices to use for the speech. + /// + /// + /// response format for the speech
+ /// Default Value: wav + /// + /// + /// speed of the speech
+ /// Default Value: 1F + /// + /// + /// Extra body parameters for the model. + /// + /// 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 OpenaiAudioSpeechAsync( + string model, + string input, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + string? voice = default, + global::DeepInfra.TtsResponseFormat? responseFormat = default, + double? speed = default, + object? extraBody = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAITextToSpeechIn + { + ServiceTier = serviceTier, + Model = model, + Input = input, + Voice = voice, + ResponseFormat = responseFormat, + Speed = speed, + ExtraBody = extraBody, + }; + + return await OpenaiAudioSpeechAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioTranscriptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioTranscriptions.g.cs new file mode 100644 index 00000000..f5b24da9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioTranscriptions.g.cs @@ -0,0 +1,1731 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AudioClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiAudioTranscriptionsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiAudioTranscriptionsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiAudioTranscriptionsSecurityRequirement0, + }; + partial void PrepareOpenaiAudioTranscriptionsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xDeepinfraSource, + ref string? xiApiKey, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request); + partial void PrepareOpenaiAudioTranscriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? xiApiKey, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request); + partial void ProcessOpenaiAudioTranscriptionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiAudioTranscriptionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Audio Transcriptions + /// + /// + /// + /// + /// 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 OpenaiAudioTranscriptionsAsync( + + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiAudioTranscriptionsAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Audio Transcriptions + /// + /// + /// + /// + /// 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> OpenaiAudioTranscriptionsAsResponseAsync( + + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranscriptionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiAudioTranscriptionsSecurityRequirements, + operationName: "OpenaiAudioTranscriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/audio/transcriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Language != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty), + name: "\"language\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + if (request.TimestampGranularities != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.TimestampGranularities.ToString() ?? string.Empty), + name: "\"timestamp_granularities\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranscriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.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); + ProcessOpenaiAudioTranscriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiAudioTranscriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Audio Transcriptions + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// + /// 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 OpenaiAudioTranscriptionsAsync( + byte[] file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost + { + File = file, + Filename = filename, + Model = model, + Language = language, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + TimestampGranularities = timestampGranularities, + }; + + return await OpenaiAudioTranscriptionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Openai Audio Transcriptions + /// + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// + /// 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 OpenaiAudioTranscriptionsAsync( + global::System.IO.Stream file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost + { + File = global::System.Array.Empty(), + Filename = filename, + Model = model, + Language = language, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + TimestampGranularities = timestampGranularities, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranscriptionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiAudioTranscriptionsSecurityRequirements, + operationName: "OpenaiAudioTranscriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/audio/transcriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Language != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty), + name: "\"language\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + if (request.TimestampGranularities != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.TimestampGranularities.ToString() ?? string.Empty), + name: "\"timestamp_granularities\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranscriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.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); + ProcessOpenaiAudioTranscriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiAudioTranscriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return __content; + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Audio Transcriptions + /// + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// + /// 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> OpenaiAudioTranscriptionsAsResponseAsync( + global::System.IO.Stream file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost + { + File = global::System.Array.Empty(), + Filename = filename, + Model = model, + Language = language, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + TimestampGranularities = timestampGranularities, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranscriptionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiAudioTranscriptionsSecurityRequirements, + operationName: "OpenaiAudioTranscriptionsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/audio/transcriptions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Language != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty), + name: "\"language\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + if (request.TimestampGranularities != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.TimestampGranularities.ToString() ?? string.Empty), + name: "\"timestamp_granularities\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranscriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.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); + ProcessOpenaiAudioTranscriptionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranscriptions", + methodName: "OpenaiAudioTranscriptionsAsync", + pathTemplate: "\"/v1/audio/transcriptions\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiAudioTranscriptionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioTranslations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioTranslations.g.cs new file mode 100644 index 00000000..b0cd5657 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioTranslations.g.cs @@ -0,0 +1,1665 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AudioClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiAudioTranslationsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiAudioTranslationsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiAudioTranslationsSecurityRequirement0, + }; + partial void PrepareOpenaiAudioTranslationsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xDeepinfraSource, + ref string? xiApiKey, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request); + partial void PrepareOpenaiAudioTranslationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? xiApiKey, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request); + partial void ProcessOpenaiAudioTranslationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiAudioTranslationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Audio Translations + /// + /// + /// + /// + /// 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 OpenaiAudioTranslationsAsync( + + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiAudioTranslationsAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Audio Translations + /// + /// + /// + /// + /// 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> OpenaiAudioTranslationsAsResponseAsync( + + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranslationsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiAudioTranslationsSecurityRequirements, + operationName: "OpenaiAudioTranslationsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/audio/translations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranslationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.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); + ProcessOpenaiAudioTranslationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiAudioTranslationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Audio Translations + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// 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 OpenaiAudioTranslationsAsync( + byte[] file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost + { + File = file, + Filename = filename, + Model = model, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + }; + + return await OpenaiAudioTranslationsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Openai Audio Translations + /// + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// 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 OpenaiAudioTranslationsAsync( + global::System.IO.Stream file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost + { + File = global::System.Array.Empty(), + Filename = filename, + Model = model, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranslationsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiAudioTranslationsSecurityRequirements, + operationName: "OpenaiAudioTranslationsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/audio/translations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranslationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.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); + ProcessOpenaiAudioTranslationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiAudioTranslationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return __content; + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Audio Translations + /// + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// 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> OpenaiAudioTranslationsAsResponseAsync( + global::System.IO.Stream file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost + { + File = global::System.Array.Empty(), + Filename = filename, + Model = model, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranslationsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiAudioTranslationsSecurityRequirements, + operationName: "OpenaiAudioTranslationsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/audio/translations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranslationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.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); + ProcessOpenaiAudioTranslationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiAudioTranslations", + methodName: "OpenaiAudioTranslationsAsync", + pathTemplate: "\"/v1/audio/translations\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiAudioTranslationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.g.cs new file mode 100644 index 00000000..56da242f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI-compatible speech synthesis, transcription, and translation.
+ /// 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 AudioClient : global::DeepInfra.IAudioClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AudioClient. + /// 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 AudioClient( + 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 AudioClient 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 AudioClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AudioClient. + /// 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 AudioClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateApiToken.g.cs new file mode 100644 index 00000000..93aa679d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateApiToken.g.cs @@ -0,0 +1,549 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateApiTokenSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_CreateApiTokenSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateApiTokenSecurityRequirement0, + }; + partial void PrepareCreateApiTokenArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.ApiTokenIn request); + partial void PrepareCreateApiTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.ApiTokenIn request); + partial void ProcessCreateApiTokenResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateApiTokenResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Api Token + /// + /// + /// + /// 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 CreateApiTokenAsync( + + global::DeepInfra.ApiTokenIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateApiTokenAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Api Token + /// + /// + /// + /// 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> CreateApiTokenAsResponseAsync( + + global::DeepInfra.ApiTokenIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateApiTokenArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateApiTokenSecurityRequirements, + operationName: "CreateApiTokenAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/api-tokens", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateApiTokenRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateApiToken", + methodName: "CreateApiTokenAsync", + pathTemplate: "\"/v1/api-tokens\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateApiToken", + methodName: "CreateApiTokenAsync", + pathTemplate: "\"/v1/api-tokens\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateApiToken", + methodName: "CreateApiTokenAsync", + pathTemplate: "\"/v1/api-tokens\"", + 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::DeepInfra.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); + ProcessCreateApiTokenResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateApiToken", + methodName: "CreateApiTokenAsync", + pathTemplate: "\"/v1/api-tokens\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateApiToken", + methodName: "CreateApiTokenAsync", + pathTemplate: "\"/v1/api-tokens\"", + 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); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessCreateApiTokenResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ApiToken.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.ApiToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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 Api Token + /// + /// + /// + /// 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 CreateApiTokenAsync( + string name, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ApiTokenIn + { + Name = name, + }; + + return await CreateApiTokenAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateScopedJwt.g.cs new file mode 100644 index 00000000..86ca6033 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateScopedJwt.g.cs @@ -0,0 +1,532 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateScopedJwtSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_CreateScopedJwtSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateScopedJwtSecurityRequirement0, + }; + partial void PrepareCreateScopedJwtArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.ScopedJWTIn request); + partial void PrepareCreateScopedJwtRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.ScopedJWTIn request); + partial void ProcessCreateScopedJwtResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateScopedJwtResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Scoped Jwt + /// + /// + /// + /// 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 CreateScopedJwtAsync( + + global::DeepInfra.ScopedJWTIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateScopedJwtAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Scoped Jwt + /// + /// + /// + /// 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> CreateScopedJwtAsResponseAsync( + + global::DeepInfra.ScopedJWTIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateScopedJwtArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateScopedJwtSecurityRequirements, + operationName: "CreateScopedJwtAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/scoped-jwt", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateScopedJwtRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateScopedJwt", + methodName: "CreateScopedJwtAsync", + pathTemplate: "\"/v1/scoped-jwt\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateScopedJwt", + methodName: "CreateScopedJwtAsync", + pathTemplate: "\"/v1/scoped-jwt\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateScopedJwt", + methodName: "CreateScopedJwtAsync", + pathTemplate: "\"/v1/scoped-jwt\"", + 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::DeepInfra.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); + ProcessCreateScopedJwtResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateScopedJwt", + methodName: "CreateScopedJwtAsync", + pathTemplate: "\"/v1/scoped-jwt\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateScopedJwt", + methodName: "CreateScopedJwtAsync", + pathTemplate: "\"/v1/scoped-jwt\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessCreateScopedJwtResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ScopedJWTOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.ScopedJWTOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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 Scoped Jwt + /// + /// + /// + /// + /// allow inference only to the specified model names + /// + /// + /// how many seconds in the future should the token be valid for + /// + /// + /// unix timestamp when the token should expire + /// + /// + /// only allow spending that much USD until the token becomes invalid + /// + /// 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 CreateScopedJwtAsync( + string apiKeyName, + string? xiApiKey = default, + global::System.Collections.Generic.IList? models = default, + int? expiresDelta = default, + int? expiresAt = default, + double? spendingLimit = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ScopedJWTIn + { + ApiKeyName = apiKeyName, + Models = models, + ExpiresDelta = expiresDelta, + ExpiresAt = expiresAt, + SpendingLimit = spendingLimit, + }; + + return await CreateScopedJwtAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateSshKey.g.cs new file mode 100644 index 00000000..a17eee1c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateSshKey.g.cs @@ -0,0 +1,556 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateSshKeySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_CreateSshKeySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateSshKeySecurityRequirement0, + }; + partial void PrepareCreateSshKeyArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.SshKeyIn request); + partial void PrepareCreateSshKeyRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.SshKeyIn request); + partial void ProcessCreateSshKeyResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateSshKeyResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Ssh Key + /// + /// + /// + /// 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 CreateSshKeyAsync( + + global::DeepInfra.SshKeyIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateSshKeyAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Ssh Key + /// + /// + /// + /// 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> CreateSshKeyAsResponseAsync( + + global::DeepInfra.SshKeyIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateSshKeyArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateSshKeySecurityRequirements, + operationName: "CreateSshKeyAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/ssh_keys", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateSshKeyRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSshKey", + methodName: "CreateSshKeyAsync", + pathTemplate: "\"/v1/ssh_keys\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSshKey", + methodName: "CreateSshKeyAsync", + pathTemplate: "\"/v1/ssh_keys\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSshKey", + methodName: "CreateSshKeyAsync", + pathTemplate: "\"/v1/ssh_keys\"", + 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::DeepInfra.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); + ProcessCreateSshKeyResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSshKey", + methodName: "CreateSshKeyAsync", + pathTemplate: "\"/v1/ssh_keys\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSshKey", + methodName: "CreateSshKeyAsync", + pathTemplate: "\"/v1/ssh_keys\"", + 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); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessCreateSshKeyResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.SshKeyOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.SshKeyOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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 Ssh Key + /// + /// + /// + /// SSH Key name + /// + /// + /// SSH Key content + /// + /// 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 CreateSshKeyAsync( + string name, + string key, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.SshKeyIn + { + Name = name, + Key = key, + }; + + return await CreateSshKeyAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.DeleteApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.DeleteApiToken.g.cs new file mode 100644 index 00000000..33bf2d4f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.DeleteApiToken.g.cs @@ -0,0 +1,509 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeleteApiTokenSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeleteApiTokenSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeleteApiTokenSecurityRequirement0, + }; + partial void PrepareDeleteApiTokenArguments( + global::System.Net.Http.HttpClient httpClient, + ref string apiToken, + ref string? xiApiKey); + partial void PrepareDeleteApiTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string apiToken, + string? xiApiKey); + partial void ProcessDeleteApiTokenResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteApiTokenResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Api Token + /// + /// + /// + /// 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 DeleteApiTokenAsync( + string apiToken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteApiTokenAsResponseAsync( + apiToken: apiToken, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Api Token + /// + /// + /// + /// 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> DeleteApiTokenAsResponseAsync( + string apiToken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteApiTokenArguments( + httpClient: HttpClient, + apiToken: ref apiToken, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteApiTokenSecurityRequirements, + operationName: "DeleteApiTokenAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/api-tokens/{apiToken}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteApiTokenRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + apiToken: apiToken!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteApiToken", + methodName: "DeleteApiTokenAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteApiToken", + methodName: "DeleteApiTokenAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteApiToken", + methodName: "DeleteApiTokenAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}\"", + httpMethod: "DELETE", + 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::DeepInfra.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); + ProcessDeleteApiTokenResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteApiToken", + methodName: "DeleteApiTokenAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteApiToken", + methodName: "DeleteApiTokenAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}\"", + httpMethod: "DELETE", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeleteApiTokenResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.DeleteSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.DeleteSshKey.g.cs new file mode 100644 index 00000000..7d25602f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.DeleteSshKey.g.cs @@ -0,0 +1,509 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeleteSshKeySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeleteSshKeySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeleteSshKeySecurityRequirement0, + }; + partial void PrepareDeleteSshKeyArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sshKeyId, + ref string? xiApiKey); + partial void PrepareDeleteSshKeyRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sshKeyId, + string? xiApiKey); + partial void ProcessDeleteSshKeyResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteSshKeyResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Ssh Key + /// + /// + /// + /// 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 DeleteSshKeyAsync( + string sshKeyId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteSshKeyAsResponseAsync( + sshKeyId: sshKeyId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Ssh Key + /// + /// + /// + /// 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> DeleteSshKeyAsResponseAsync( + string sshKeyId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteSshKeyArguments( + httpClient: HttpClient, + sshKeyId: ref sshKeyId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteSshKeySecurityRequirements, + operationName: "DeleteSshKeyAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/ssh_keys/{sshKeyId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteSshKeyRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sshKeyId: sshKeyId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteSshKey", + methodName: "DeleteSshKeyAsync", + pathTemplate: "$\"/v1/ssh_keys/{sshKeyId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteSshKey", + methodName: "DeleteSshKeyAsync", + pathTemplate: "$\"/v1/ssh_keys/{sshKeyId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteSshKey", + methodName: "DeleteSshKeyAsync", + pathTemplate: "$\"/v1/ssh_keys/{sshKeyId}\"", + httpMethod: "DELETE", + 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::DeepInfra.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); + ProcessDeleteSshKeyResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteSshKey", + methodName: "DeleteSshKeyAsync", + pathTemplate: "$\"/v1/ssh_keys/{sshKeyId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteSshKey", + methodName: "DeleteSshKeyAsync", + pathTemplate: "$\"/v1/ssh_keys/{sshKeyId}\"", + httpMethod: "DELETE", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeleteSshKeyResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.ExportApiTokenToVercel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.ExportApiTokenToVercel.g.cs new file mode 100644 index 00000000..81b79d99 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.ExportApiTokenToVercel.g.cs @@ -0,0 +1,569 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ExportApiTokenToVercelSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ExportApiTokenToVercelSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ExportApiTokenToVercelSecurityRequirement0, + }; + partial void PrepareExportApiTokenToVercelArguments( + global::System.Net.Http.HttpClient httpClient, + ref string apiToken, + ref string? xiApiKey, + global::DeepInfra.ApiTokenVercelExportIn request); + partial void PrepareExportApiTokenToVercelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string apiToken, + string? xiApiKey, + global::DeepInfra.ApiTokenVercelExportIn request); + partial void ProcessExportApiTokenToVercelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessExportApiTokenToVercelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Export Api Token To Vercel + /// + /// + /// + /// + /// 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 ExportApiTokenToVercelAsync( + string apiToken, + + global::DeepInfra.ApiTokenVercelExportIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExportApiTokenToVercelAsResponseAsync( + apiToken: apiToken, + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Export Api Token To Vercel + /// + /// + /// + /// + /// 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> ExportApiTokenToVercelAsResponseAsync( + string apiToken, + + global::DeepInfra.ApiTokenVercelExportIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareExportApiTokenToVercelArguments( + httpClient: HttpClient, + apiToken: ref apiToken, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ExportApiTokenToVercelSecurityRequirements, + operationName: "ExportApiTokenToVercelAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/api-tokens/{apiToken}/vercel_export", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareExportApiTokenToVercelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + apiToken: apiToken!, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExportApiTokenToVercel", + methodName: "ExportApiTokenToVercelAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}/vercel_export\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExportApiTokenToVercel", + methodName: "ExportApiTokenToVercelAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}/vercel_export\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExportApiTokenToVercel", + methodName: "ExportApiTokenToVercelAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}/vercel_export\"", + 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::DeepInfra.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); + ProcessExportApiTokenToVercelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExportApiTokenToVercel", + methodName: "ExportApiTokenToVercelAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}/vercel_export\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExportApiTokenToVercel", + methodName: "ExportApiTokenToVercelAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}/vercel_export\"", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessExportApiTokenToVercelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Export Api Token To Vercel + /// + /// + /// + /// + /// + /// + /// + /// + /// 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 ExportApiTokenToVercelAsync( + string apiToken, + string projectIdOrName, + bool isSensitive, + bool envDevelopment, + bool envPreview, + bool envProduction, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ApiTokenVercelExportIn + { + ProjectIdOrName = projectIdOrName, + IsSensitive = isSensitive, + EnvDevelopment = envDevelopment, + EnvPreview = envPreview, + EnvProduction = envProduction, + }; + + return await ExportApiTokenToVercelAsync( + apiToken: apiToken, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetApiToken.g.cs new file mode 100644 index 00000000..68938135 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetApiToken.g.cs @@ -0,0 +1,513 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetApiTokenSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetApiTokenSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetApiTokenSecurityRequirement0, + }; + partial void PrepareGetApiTokenArguments( + global::System.Net.Http.HttpClient httpClient, + ref string apiToken, + ref string? xiApiKey); + partial void PrepareGetApiTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string apiToken, + string? xiApiKey); + partial void ProcessGetApiTokenResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetApiTokenResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Api Token + /// + /// + /// + /// 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 GetApiTokenAsync( + string apiToken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApiTokenAsResponseAsync( + apiToken: apiToken, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Api Token + /// + /// + /// + /// 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> GetApiTokenAsResponseAsync( + string apiToken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetApiTokenArguments( + httpClient: HttpClient, + apiToken: ref apiToken, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetApiTokenSecurityRequirements, + operationName: "GetApiTokenAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/api-tokens/{apiToken}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetApiTokenRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + apiToken: apiToken!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetApiToken", + methodName: "GetApiTokenAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetApiToken", + methodName: "GetApiTokenAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetApiToken", + methodName: "GetApiTokenAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetApiTokenResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetApiToken", + methodName: "GetApiTokenAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetApiToken", + methodName: "GetApiTokenAsync", + pathTemplate: "$\"/v1/api-tokens/{apiToken}\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetApiTokenResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ApiToken.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.ApiToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetApiTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetApiTokens.g.cs new file mode 100644 index 00000000..3d868ba1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetApiTokens.g.cs @@ -0,0 +1,467 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetApiTokensSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetApiTokensSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetApiTokensSecurityRequirement0, + }; + partial void PrepareGetApiTokensArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareGetApiTokensRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessGetApiTokensResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetApiTokensResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Api Tokens + /// + /// + /// 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> GetApiTokensAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApiTokensAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Api Tokens + /// + /// + /// 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>> GetApiTokensAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetApiTokensArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetApiTokensSecurityRequirements, + operationName: "GetApiTokensAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/api-tokens", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetApiTokensRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetApiTokens", + methodName: "GetApiTokensAsync", + pathTemplate: "\"/v1/api-tokens\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetApiTokens", + methodName: "GetApiTokensAsync", + pathTemplate: "\"/v1/api-tokens\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetApiTokens", + methodName: "GetApiTokensAsync", + pathTemplate: "\"/v1/api-tokens\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetApiTokensResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetApiTokens", + methodName: "GetApiTokensAsync", + pathTemplate: "\"/v1/api-tokens\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetApiTokens", + methodName: "GetApiTokensAsync", + pathTemplate: "\"/v1/api-tokens\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetApiTokensResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetSshKeys.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetSshKeys.g.cs new file mode 100644 index 00000000..75a2fcc0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetSshKeys.g.cs @@ -0,0 +1,467 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetSshKeysSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetSshKeysSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetSshKeysSecurityRequirement0, + }; + partial void PrepareGetSshKeysArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareGetSshKeysRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessGetSshKeysResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetSshKeysResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Ssh Keys + /// + /// + /// 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> GetSshKeysAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSshKeysAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Ssh Keys + /// + /// + /// 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>> GetSshKeysAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetSshKeysArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetSshKeysSecurityRequirements, + operationName: "GetSshKeysAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/ssh_keys", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetSshKeysRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetSshKeys", + methodName: "GetSshKeysAsync", + pathTemplate: "\"/v1/ssh_keys\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetSshKeys", + methodName: "GetSshKeysAsync", + pathTemplate: "\"/v1/ssh_keys\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetSshKeys", + methodName: "GetSshKeysAsync", + pathTemplate: "\"/v1/ssh_keys\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetSshKeysResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetSshKeys", + methodName: "GetSshKeysAsync", + pathTemplate: "\"/v1/ssh_keys\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetSshKeys", + methodName: "GetSshKeysAsync", + pathTemplate: "\"/v1/ssh_keys\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetSshKeysResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GithubCliLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GithubCliLogin.g.cs new file mode 100644 index 00000000..1729d173 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GithubCliLogin.g.cs @@ -0,0 +1,464 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GithubCliLoginSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GithubCliLoginSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GithubCliLoginSecurityRequirement0, + }; + partial void PrepareGithubCliLoginArguments( + global::System.Net.Http.HttpClient httpClient, + ref string loginId); + partial void PrepareGithubCliLoginRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loginId); + partial void ProcessGithubCliLoginResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGithubCliLoginResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Github Cli Login
+ /// deepctl is calling this request waiting for auth token during login.
+ /// The token is stored in /github/callback + ///
+ /// + /// 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 GithubCliLoginAsync( + string loginId, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GithubCliLoginAsResponseAsync( + loginId: loginId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Github Cli Login
+ /// deepctl is calling this request waiting for auth token during login.
+ /// The token is stored in /github/callback + ///
+ /// + /// 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> GithubCliLoginAsResponseAsync( + string loginId, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGithubCliLoginArguments( + httpClient: HttpClient, + loginId: ref loginId); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GithubCliLoginSecurityRequirements, + operationName: "GithubCliLoginAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/github/cli/login", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("login_id", loginId) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGithubCliLoginRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + loginId: loginId!); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubCliLogin", + methodName: "GithubCliLoginAsync", + pathTemplate: "\"/github/cli/login\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubCliLogin", + methodName: "GithubCliLoginAsync", + pathTemplate: "\"/github/cli/login\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubCliLogin", + methodName: "GithubCliLoginAsync", + pathTemplate: "\"/github/cli/login\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGithubCliLoginResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubCliLogin", + methodName: "GithubCliLoginAsync", + pathTemplate: "\"/github/cli/login\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubCliLogin", + methodName: "GithubCliLoginAsync", + pathTemplate: "\"/github/cli/login\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGithubCliLoginResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GithubLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GithubLogin.g.cs new file mode 100644 index 00000000..d9bf9912 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GithubLogin.g.cs @@ -0,0 +1,492 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GithubLoginSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GithubLoginSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GithubLoginSecurityRequirement0, + }; + partial void PrepareGithubLoginArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? loginId, + ref string? origin, + ref string? deal, + ref string? tiToken); + partial void PrepareGithubLoginRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? loginId, + string? origin, + string? deal, + string? tiToken); + partial void ProcessGithubLoginResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGithubLoginResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Github Login
+ /// Initiate github SSO login flow. Callback is /github/callback + ///
+ /// + /// + /// + /// + /// 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 GithubLoginAsync( + string? loginId = default, + string? origin = default, + string? deal = default, + string? tiToken = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GithubLoginAsResponseAsync( + loginId: loginId, + origin: origin, + deal: deal, + tiToken: tiToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Github Login
+ /// Initiate github SSO login flow. Callback is /github/callback + ///
+ /// + /// + /// + /// + /// 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> GithubLoginAsResponseAsync( + string? loginId = default, + string? origin = default, + string? deal = default, + string? tiToken = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGithubLoginArguments( + httpClient: HttpClient, + loginId: ref loginId, + origin: ref origin, + deal: ref deal, + tiToken: ref tiToken); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GithubLoginSecurityRequirements, + operationName: "GithubLoginAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/github/login", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("login_id", loginId) + .AddOptionalParameter("origin", origin) + .AddOptionalParameter("deal", deal) + .AddOptionalParameter("ti_token", tiToken) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGithubLoginRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + loginId: loginId, + origin: origin, + deal: deal, + tiToken: tiToken); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubLogin", + methodName: "GithubLoginAsync", + pathTemplate: "\"/github/login\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubLogin", + methodName: "GithubLoginAsync", + pathTemplate: "\"/github/login\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubLogin", + methodName: "GithubLoginAsync", + pathTemplate: "\"/github/login\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGithubLoginResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubLogin", + methodName: "GithubLoginAsync", + pathTemplate: "\"/github/login\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubLogin", + methodName: "GithubLoginAsync", + pathTemplate: "\"/github/login\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGithubLoginResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.InspectScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.InspectScopedJwt.g.cs new file mode 100644 index 00000000..b3634158 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.InspectScopedJwt.g.cs @@ -0,0 +1,479 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_InspectScopedJwtSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_InspectScopedJwtSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_InspectScopedJwtSecurityRequirement0, + }; + partial void PrepareInspectScopedJwtArguments( + global::System.Net.Http.HttpClient httpClient, + ref string jwtoken, + ref string? xiApiKey); + partial void PrepareInspectScopedJwtRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string jwtoken, + string? xiApiKey); + partial void ProcessInspectScopedJwtResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessInspectScopedJwtResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Inspect Scoped Jwt + /// + /// + /// + /// 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 InspectScopedJwtAsync( + string jwtoken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InspectScopedJwtAsResponseAsync( + jwtoken: jwtoken, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Inspect Scoped Jwt + /// + /// + /// + /// 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> InspectScopedJwtAsResponseAsync( + string jwtoken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareInspectScopedJwtArguments( + httpClient: HttpClient, + jwtoken: ref jwtoken, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_InspectScopedJwtSecurityRequirements, + operationName: "InspectScopedJwtAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/scoped-jwt", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("jwtoken", jwtoken) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareInspectScopedJwtRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + jwtoken: jwtoken!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InspectScopedJwt", + methodName: "InspectScopedJwtAsync", + pathTemplate: "\"/v1/scoped-jwt\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InspectScopedJwt", + methodName: "InspectScopedJwtAsync", + pathTemplate: "\"/v1/scoped-jwt\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InspectScopedJwt", + methodName: "InspectScopedJwtAsync", + pathTemplate: "\"/v1/scoped-jwt\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessInspectScopedJwtResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InspectScopedJwt", + methodName: "InspectScopedJwtAsync", + pathTemplate: "\"/v1/scoped-jwt\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InspectScopedJwt", + methodName: "InspectScopedJwtAsync", + pathTemplate: "\"/v1/scoped-jwt\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessInspectScopedJwtResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.InspectScopedJWTOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.InspectScopedJWTOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.OktaLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.OktaLogin.g.cs new file mode 100644 index 00000000..7350a0e5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.OktaLogin.g.cs @@ -0,0 +1,480 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OktaLoginSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OktaLoginSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OktaLoginSecurityRequirement0, + }; + partial void PrepareOktaLoginArguments( + global::System.Net.Http.HttpClient httpClient, + ref string teamId, + ref string? origin, + ref string? loginId); + partial void PrepareOktaLoginRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string teamId, + string? origin, + string? loginId); + partial void ProcessOktaLoginResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOktaLoginResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Okta Login + /// + /// + /// + /// + /// 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 OktaLoginAsync( + string teamId, + string? origin = default, + string? loginId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OktaLoginAsResponseAsync( + teamId: teamId, + origin: origin, + loginId: loginId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Okta Login + /// + /// + /// + /// + /// 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> OktaLoginAsResponseAsync( + string teamId, + string? origin = default, + string? loginId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOktaLoginArguments( + httpClient: HttpClient, + teamId: ref teamId, + origin: ref origin, + loginId: ref loginId); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OktaLoginSecurityRequirements, + operationName: "OktaLoginAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/okta/login", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("team_id", teamId) + .AddOptionalParameter("origin", origin) + .AddOptionalParameter("login_id", loginId) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOktaLoginRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + teamId: teamId!, + origin: origin, + loginId: loginId); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OktaLogin", + methodName: "OktaLoginAsync", + pathTemplate: "\"/okta/login\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OktaLogin", + methodName: "OktaLoginAsync", + pathTemplate: "\"/okta/login\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OktaLogin", + methodName: "OktaLoginAsync", + pathTemplate: "\"/okta/login\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessOktaLoginResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OktaLogin", + methodName: "OktaLoginAsync", + pathTemplate: "\"/okta/login\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OktaLogin", + methodName: "OktaLoginAsync", + pathTemplate: "\"/okta/login\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOktaLoginResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.g.cs new file mode 100644 index 00000000..6529b629 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// API tokens, SSH keys, scoped JWTs, and login flows.
+ /// 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 AuthenticationClient : global::DeepInfra.IAuthenticationClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AuthenticationClient. + /// 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 AuthenticationClient( + 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 AuthenticationClient 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 AuthenticationClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AuthenticationClient. + /// 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 AuthenticationClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.AutoSDKHttpResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AutoSDKHttpResponse.g.cs new file mode 100644 index 00000000..0e7d294a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Represents a successful HTTP response with status code and headers. + /// + public partial class AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri) + { + StatusCode = statusCode; + Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers)); + RequestUri = requestUri; + } + + /// + /// Gets the HTTP status code. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// Gets the response headers. + /// + public global::System.Collections.Generic.Dictionary> Headers { get; } + /// + /// Gets the final request URI associated with the response. + /// + public global::System.Uri? RequestUri { get; } + + internal static global::System.Collections.Generic.Dictionary> CreateHeaders( + global::System.Net.Http.HttpResponseMessage response) + { + response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + + var headers = global::System.Linq.Enumerable.ToDictionary( + response.Headers, + static header => header.Key, + static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value), + global::System.StringComparer.OrdinalIgnoreCase); + + if (response.Content?.Headers == null) + { + return headers; + } + + foreach (var header in response.Content.Headers) + { + if (headers.TryGetValue(header.Key, out var existingValues)) + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray( + global::System.Linq.Enumerable.Concat(existingValues, header.Value)); + } + else + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value); + } + } + + return headers; + } + } + + /// + /// Represents a successful HTTP response with status code, headers, and body. + /// + public partial class AutoSDKHttpResponse : AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + T body) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null, + body: body) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri, + T body) + : base(statusCode, headers, requestUri) + { + Body = body; + } + + /// + /// Gets the response body. + /// + public T Body { get; } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.AddFunds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.AddFunds.g.cs new file mode 100644 index 00000000..7fae4eb4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.AddFunds.g.cs @@ -0,0 +1,541 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_AddFundsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_AddFundsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_AddFundsSecurityRequirement0, + }; + partial void PrepareAddFundsArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? useCheckout, + object? session, + global::DeepInfra.AddFundsIn request); + partial void PrepareAddFundsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? useCheckout, + object? session, + global::DeepInfra.AddFundsIn request); + partial void ProcessAddFundsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAddFundsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// 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 AddFundsAsync( + + global::DeepInfra.AddFundsIn request, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AddFundsAsResponseAsync( + + request: request, + useCheckout: useCheckout, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// 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> AddFundsAsResponseAsync( + + global::DeepInfra.AddFundsIn request, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAddFundsArguments( + httpClient: HttpClient, + useCheckout: ref useCheckout, + session: session, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AddFundsSecurityRequirements, + operationName: "AddFundsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/funds", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("use_checkout", useCheckout?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAddFundsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + useCheckout: useCheckout, + session: session, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddFunds", + methodName: "AddFundsAsync", + pathTemplate: "\"/payment/funds\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddFunds", + methodName: "AddFundsAsync", + pathTemplate: "\"/payment/funds\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddFunds", + methodName: "AddFundsAsync", + pathTemplate: "\"/payment/funds\"", + 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::DeepInfra.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); + ProcessAddFundsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddFunds", + methodName: "AddFundsAsync", + pathTemplate: "\"/payment/funds\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddFunds", + methodName: "AddFundsAsync", + pathTemplate: "\"/payment/funds\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessAddFundsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.AddFundsOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.AddFundsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// Amount to add in cents + /// + /// 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 AddFundsAsync( + int amount, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.AddFundsIn + { + Amount = amount, + }; + + return await AddFundsAsync( + useCheckout: useCheckout, + session: session, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.BillingPortal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.BillingPortal.g.cs new file mode 100644 index 00000000..32f725d2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.BillingPortal.g.cs @@ -0,0 +1,485 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_BillingPortalSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_BillingPortalSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_BillingPortalSecurityRequirement0, + }; + partial void PrepareBillingPortalArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? returnUrl, + object? session); + partial void PrepareBillingPortalRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? returnUrl, + object? session); + partial void ProcessBillingPortalResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessBillingPortalResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Billing Portal + /// + /// + /// + /// 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 BillingPortalAsync( + string? returnUrl = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BillingPortalAsResponseAsync( + returnUrl: returnUrl, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Billing Portal + /// + /// + /// + /// 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> BillingPortalAsResponseAsync( + string? returnUrl = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareBillingPortalArguments( + httpClient: HttpClient, + returnUrl: ref returnUrl, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BillingPortalSecurityRequirements, + operationName: "BillingPortalAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/billing-portal", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("return_url", returnUrl) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareBillingPortalRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + returnUrl: returnUrl, + session: session); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BillingPortal", + methodName: "BillingPortalAsync", + pathTemplate: "\"/payment/billing-portal\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BillingPortal", + methodName: "BillingPortalAsync", + pathTemplate: "\"/payment/billing-portal\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BillingPortal", + methodName: "BillingPortalAsync", + pathTemplate: "\"/payment/billing-portal\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessBillingPortalResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BillingPortal", + methodName: "BillingPortalAsync", + pathTemplate: "\"/payment/billing-portal\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BillingPortal", + methodName: "BillingPortalAsync", + pathTemplate: "\"/payment/billing-portal\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessBillingPortalResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.BillingPortalOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.BillingPortalOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.DeepstartApply.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.DeepstartApply.g.cs new file mode 100644 index 00000000..6d95d5c5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.DeepstartApply.g.cs @@ -0,0 +1,547 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeepstartApplySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeepstartApplySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeepstartApplySecurityRequirement0, + }; + partial void PrepareDeepstartApplyArguments( + global::System.Net.Http.HttpClient httpClient, + object? session, + global::DeepInfra.DeepStartApplicationIn request); + partial void PrepareDeepstartApplyRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + object? session, + global::DeepInfra.DeepStartApplicationIn request); + partial void ProcessDeepstartApplyResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeepstartApplyResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deepstart Apply + /// + /// + /// + /// 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 DeepstartApplyAsync( + + global::DeepInfra.DeepStartApplicationIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeepstartApplyAsResponseAsync( + + request: request, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deepstart Apply + /// + /// + /// + /// 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> DeepstartApplyAsResponseAsync( + + global::DeepInfra.DeepStartApplicationIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDeepstartApplyArguments( + httpClient: HttpClient, + session: session, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeepstartApplySecurityRequirements, + operationName: "DeepstartApplyAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/deepstart/application", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeepstartApplyRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + session: session, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeepstartApply", + methodName: "DeepstartApplyAsync", + pathTemplate: "\"/payment/deepstart/application\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeepstartApply", + methodName: "DeepstartApplyAsync", + pathTemplate: "\"/payment/deepstart/application\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeepstartApply", + methodName: "DeepstartApplyAsync", + pathTemplate: "\"/payment/deepstart/application\"", + 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::DeepInfra.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); + ProcessDeepstartApplyResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeepstartApply", + methodName: "DeepstartApplyAsync", + pathTemplate: "\"/payment/deepstart/application\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeepstartApply", + methodName: "DeepstartApplyAsync", + pathTemplate: "\"/payment/deepstart/application\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeepstartApplyResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeepStartApplicationOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeepStartApplicationOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Deepstart Apply + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: pending + /// + /// + /// 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 DeepstartApplyAsync( + string company, + string ceo, + string funding, + string foundedOn, + string website, + object? session = default, + string? id = default, + string? uid = default, + int? createdAt = default, + string? status = default, + string? deal = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.DeepStartApplicationIn + { + Id = id, + Uid = uid, + Company = company, + Ceo = ceo, + Funding = funding, + FoundedOn = foundedOn, + Website = website, + CreatedAt = createdAt, + Status = status, + Deal = deal, + }; + + return await DeepstartApplyAsync( + session: session, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetChecklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetChecklist.g.cs new file mode 100644 index 00000000..886d825d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetChecklist.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetChecklistSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetChecklistSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetChecklistSecurityRequirement0, + }; + partial void PrepareGetChecklistArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? computeOwed, + object? session); + partial void PrepareGetChecklistRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? computeOwed, + object? session); + partial void ProcessGetChecklistResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetChecklistResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Checklist + /// + /// + /// Default Value: false + /// + /// + /// 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 GetChecklistAsync( + bool? computeOwed = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetChecklistAsResponseAsync( + computeOwed: computeOwed, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Checklist + /// + /// + /// Default Value: false + /// + /// + /// 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> GetChecklistAsResponseAsync( + bool? computeOwed = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetChecklistArguments( + httpClient: HttpClient, + computeOwed: ref computeOwed, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetChecklistSecurityRequirements, + operationName: "GetChecklistAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/checklist", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("compute_owed", computeOwed?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetChecklistRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + computeOwed: computeOwed, + session: session); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetChecklist", + methodName: "GetChecklistAsync", + pathTemplate: "\"/payment/checklist\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetChecklist", + methodName: "GetChecklistAsync", + pathTemplate: "\"/payment/checklist\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetChecklist", + methodName: "GetChecklistAsync", + pathTemplate: "\"/payment/checklist\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetChecklistResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetChecklist", + methodName: "GetChecklistAsync", + pathTemplate: "\"/payment/checklist\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetChecklist", + methodName: "GetChecklistAsync", + pathTemplate: "\"/payment/checklist\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetChecklistResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.Checklist.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.Checklist.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetConfig.g.cs new file mode 100644 index 00000000..9bf42f65 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetConfig.g.cs @@ -0,0 +1,473 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetConfigSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetConfigSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetConfigSecurityRequirement0, + }; + partial void PrepareGetConfigArguments( + global::System.Net.Http.HttpClient httpClient, + object? session); + partial void PrepareGetConfigRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + object? session); + partial void ProcessGetConfigResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetConfigResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Config + /// + /// + /// 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 GetConfigAsync( + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetConfigAsResponseAsync( + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Config + /// + /// + /// 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> GetConfigAsResponseAsync( + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetConfigArguments( + httpClient: HttpClient, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetConfigSecurityRequirements, + operationName: "GetConfigAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/config", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetConfigRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + session: session); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfig", + methodName: "GetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfig", + methodName: "GetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfig", + methodName: "GetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetConfigResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfig", + methodName: "GetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfig", + methodName: "GetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetConfigResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ConfigOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.ConfigOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.ListInvoices.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.ListInvoices.g.cs new file mode 100644 index 00000000..f8a8de9b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.ListInvoices.g.cs @@ -0,0 +1,509 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ListInvoicesSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ListInvoicesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ListInvoicesSecurityRequirement0, + }; + partial void PrepareListInvoicesArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? limit, + ref string? startingAfter, + ref string? invoiceType, + object? session); + partial void PrepareListInvoicesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? limit, + string? startingAfter, + string? invoiceType, + object? session); + partial void ProcessListInvoicesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListInvoicesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Invoices + /// + /// + /// Default Value: 10 + /// + /// + /// + /// + /// 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 ListInvoicesAsync( + int? limit = default, + string? startingAfter = default, + string? invoiceType = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListInvoicesAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + invoiceType: invoiceType, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Invoices + /// + /// + /// Default Value: 10 + /// + /// + /// + /// + /// 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> ListInvoicesAsResponseAsync( + int? limit = default, + string? startingAfter = default, + string? invoiceType = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListInvoicesArguments( + httpClient: HttpClient, + limit: ref limit, + startingAfter: ref startingAfter, + invoiceType: ref invoiceType, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListInvoicesSecurityRequirements, + operationName: "ListInvoicesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/invoices", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("starting_after", startingAfter) + .AddOptionalParameter("invoice_type", invoiceType) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListInvoicesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + limit: limit, + startingAfter: startingAfter, + invoiceType: invoiceType, + session: session); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInvoices", + methodName: "ListInvoicesAsync", + pathTemplate: "\"/payment/invoices\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInvoices", + methodName: "ListInvoicesAsync", + pathTemplate: "\"/payment/invoices\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInvoices", + methodName: "ListInvoicesAsync", + pathTemplate: "\"/payment/invoices\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessListInvoicesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInvoices", + methodName: "ListInvoicesAsync", + pathTemplate: "\"/payment/invoices\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInvoices", + methodName: "ListInvoicesAsync", + pathTemplate: "\"/payment/invoices\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessListInvoicesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.InvoicesOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.InvoicesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetConfig.g.cs new file mode 100644 index 00000000..32b20ac9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetConfig.g.cs @@ -0,0 +1,520 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_SetConfigSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_SetConfigSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_SetConfigSecurityRequirement0, + }; + partial void PrepareSetConfigArguments( + global::System.Net.Http.HttpClient httpClient, + object? session, + global::DeepInfra.ConfigIn request); + partial void PrepareSetConfigRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + object? session, + global::DeepInfra.ConfigIn request); + partial void ProcessSetConfigResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessSetConfigResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Set Config + /// + /// + /// + /// 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 SetConfigAsync( + + global::DeepInfra.ConfigIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SetConfigAsResponseAsync( + + request: request, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Set Config + /// + /// + /// + /// 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> SetConfigAsResponseAsync( + + global::DeepInfra.ConfigIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareSetConfigArguments( + httpClient: HttpClient, + session: session, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SetConfigSecurityRequirements, + operationName: "SetConfigAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/config", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSetConfigRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + session: session, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetConfig", + methodName: "SetConfigAsync", + pathTemplate: "\"/payment/config\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetConfig", + methodName: "SetConfigAsync", + pathTemplate: "\"/payment/config\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetConfig", + methodName: "SetConfigAsync", + pathTemplate: "\"/payment/config\"", + 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::DeepInfra.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); + ProcessSetConfigResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetConfig", + methodName: "SetConfigAsync", + pathTemplate: "\"/payment/config\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetConfig", + methodName: "SetConfigAsync", + pathTemplate: "\"/payment/config\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessSetConfigResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ConfigOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.ConfigOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Set Config + /// + /// + /// + /// Set usage limit (in USD). Negative means no limit.null/not-set means don't change it + /// + /// 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 SetConfigAsync( + object? session = default, + double? limit = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ConfigIn + { + Limit = limit, + }; + + return await SetConfigAsync( + session: session, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetupTopup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetupTopup.g.cs new file mode 100644 index 00000000..79bfa66f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetupTopup.g.cs @@ -0,0 +1,529 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_SetupTopupSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_SetupTopupSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_SetupTopupSecurityRequirement0, + }; + partial void PrepareSetupTopupArguments( + global::System.Net.Http.HttpClient httpClient, + object? session, + global::DeepInfra.TopUpIn request); + partial void PrepareSetupTopupRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + object? session, + global::DeepInfra.TopUpIn request); + partial void ProcessSetupTopupResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessSetupTopupResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Setup Topup + /// + /// + /// + /// 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 SetupTopupAsync( + + global::DeepInfra.TopUpIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SetupTopupAsResponseAsync( + + request: request, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Setup Topup + /// + /// + /// + /// 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> SetupTopupAsResponseAsync( + + global::DeepInfra.TopUpIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareSetupTopupArguments( + httpClient: HttpClient, + session: session, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SetupTopupSecurityRequirements, + operationName: "SetupTopupAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/topup", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSetupTopupRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + session: session, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetupTopup", + methodName: "SetupTopupAsync", + pathTemplate: "\"/payment/topup\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetupTopup", + methodName: "SetupTopupAsync", + pathTemplate: "\"/payment/topup\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetupTopup", + methodName: "SetupTopupAsync", + pathTemplate: "\"/payment/topup\"", + 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::DeepInfra.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); + ProcessSetupTopupResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetupTopup", + methodName: "SetupTopupAsync", + pathTemplate: "\"/payment/topup\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetupTopup", + methodName: "SetupTopupAsync", + pathTemplate: "\"/payment/topup\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessSetupTopupResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Setup Topup + /// + /// + /// + /// Amount to top up in cents
+ /// Default Value: 0 + /// + /// + /// Top up threshold in cents, if balance goes below this value, top up will be triggered
+ /// Default Value: 0 + /// + /// + /// If true, top up will be triggered when balance goes below threshold
+ /// Default Value: true + /// + /// 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 SetupTopupAsync( + object? session = default, + int? amount = default, + int? threshold = default, + bool? enabled = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.TopUpIn + { + Amount = amount, + Threshold = threshold, + Enabled = enabled, + }; + + return await SetupTopupAsync( + session: session, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.Usage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.Usage.g.cs new file mode 100644 index 00000000..99e42f3b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.Usage.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UsageSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UsageSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UsageSecurityRequirement0, + }; + partial void PrepareUsageArguments( + global::System.Net.Http.HttpClient httpClient, + ref string from, + ref string? to, + object? session); + partial void PrepareUsageRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string from, + string? to, + object? session); + partial void ProcessUsageResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUsageResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Usage + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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 UsageAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UsageAsResponseAsync( + from: from, + to: to, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Usage + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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> UsageAsResponseAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareUsageArguments( + httpClient: HttpClient, + from: ref from, + to: ref to, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UsageSecurityRequirements, + operationName: "UsageAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/usage", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from) + .AddOptionalParameter("to", to) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUsageRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + from: from!, + to: to, + session: session); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Usage", + methodName: "UsageAsync", + pathTemplate: "\"/payment/usage\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Usage", + methodName: "UsageAsync", + pathTemplate: "\"/payment/usage\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Usage", + methodName: "UsageAsync", + pathTemplate: "\"/payment/usage\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessUsageResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Usage", + methodName: "UsageAsync", + pathTemplate: "\"/payment/usage\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Usage", + methodName: "UsageAsync", + pathTemplate: "\"/payment/usage\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessUsageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageApiToken.g.cs new file mode 100644 index 00000000..9e5cbd48 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageApiToken.g.cs @@ -0,0 +1,512 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UsageApiTokenSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UsageApiTokenSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UsageApiTokenSecurityRequirement0, + }; + partial void PrepareUsageApiTokenArguments( + global::System.Net.Http.HttpClient httpClient, + ref string apiToken, + ref string from, + ref string? to, + object? session); + partial void PrepareUsageApiTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string apiToken, + string from, + string? to, + object? session); + partial void ProcessUsageApiTokenResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUsageApiTokenResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Usage Api Token + /// + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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 UsageApiTokenAsync( + string apiToken, + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UsageApiTokenAsResponseAsync( + apiToken: apiToken, + from: from, + to: to, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Usage Api Token + /// + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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> UsageApiTokenAsResponseAsync( + string apiToken, + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareUsageApiTokenArguments( + httpClient: HttpClient, + apiToken: ref apiToken, + from: ref from, + to: ref to, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UsageApiTokenSecurityRequirements, + operationName: "UsageApiTokenAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/payment/usage/{apiToken}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from) + .AddOptionalParameter("to", to) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUsageApiTokenRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + apiToken: apiToken!, + from: from!, + to: to, + session: session); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageApiToken", + methodName: "UsageApiTokenAsync", + pathTemplate: "$\"/payment/usage/{apiToken}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageApiToken", + methodName: "UsageApiTokenAsync", + pathTemplate: "$\"/payment/usage/{apiToken}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageApiToken", + methodName: "UsageApiTokenAsync", + pathTemplate: "$\"/payment/usage/{apiToken}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessUsageApiTokenResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageApiToken", + methodName: "UsageApiTokenAsync", + pathTemplate: "$\"/payment/usage/{apiToken}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageApiToken", + methodName: "UsageApiTokenAsync", + pathTemplate: "$\"/payment/usage/{apiToken}\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessUsageApiTokenResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageRent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageRent.g.cs new file mode 100644 index 00000000..f1711a4b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageRent.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UsageRentSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UsageRentSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UsageRentSecurityRequirement0, + }; + partial void PrepareUsageRentArguments( + global::System.Net.Http.HttpClient httpClient, + ref int from, + int? to, + object? session); + partial void PrepareUsageRentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int from, + int? to, + object? session); + partial void ProcessUsageRentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUsageRentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Usage Rent + /// + /// + /// start of period, in seconds since unix epoch + /// + /// + /// end of period, in seconds since unix epoch + /// + /// + /// 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 UsageRentAsync( + int from, + int? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UsageRentAsResponseAsync( + from: from, + to: to, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Usage Rent + /// + /// + /// start of period, in seconds since unix epoch + /// + /// + /// end of period, in seconds since unix epoch + /// + /// + /// 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> UsageRentAsResponseAsync( + int from, + int? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareUsageRentArguments( + httpClient: HttpClient, + from: ref from, + to: to, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UsageRentSecurityRequirements, + operationName: "UsageRentAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/usage/rent", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from.ToString()!) + .AddOptionalParameter("to", to?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUsageRentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + from: from!, + to: to, + session: session); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageRent", + methodName: "UsageRentAsync", + pathTemplate: "\"/payment/usage/rent\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageRent", + methodName: "UsageRentAsync", + pathTemplate: "\"/payment/usage/rent\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageRent", + methodName: "UsageRentAsync", + pathTemplate: "\"/payment/usage/rent\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessUsageRentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageRent", + methodName: "UsageRentAsync", + pathTemplate: "\"/payment/usage/rent\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageRent", + methodName: "UsageRentAsync", + pathTemplate: "\"/payment/usage/rent\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessUsageRentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.UsageRentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.UsageRentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageTokens.g.cs new file mode 100644 index 00000000..974d3cc5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageTokens.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UsageTokensSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UsageTokensSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UsageTokensSecurityRequirement0, + }; + partial void PrepareUsageTokensArguments( + global::System.Net.Http.HttpClient httpClient, + ref string from, + ref string? to, + object? session); + partial void PrepareUsageTokensRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string from, + string? to, + object? session); + partial void ProcessUsageTokensResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUsageTokensResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Usage Tokens + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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 UsageTokensAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UsageTokensAsResponseAsync( + from: from, + to: to, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Usage Tokens + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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> UsageTokensAsResponseAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareUsageTokensArguments( + httpClient: HttpClient, + from: ref from, + to: ref to, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UsageTokensSecurityRequirements, + operationName: "UsageTokensAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/usage/tokens", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from) + .AddOptionalParameter("to", to) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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 + + var __cookies = new global::System.Collections.Generic.List(); + + 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 __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUsageTokensRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + from: from!, + to: to, + session: session); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageTokens", + methodName: "UsageTokensAsync", + pathTemplate: "\"/payment/usage/tokens\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageTokens", + methodName: "UsageTokensAsync", + pathTemplate: "\"/payment/usage/tokens\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageTokens", + methodName: "UsageTokensAsync", + pathTemplate: "\"/payment/usage/tokens\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessUsageTokensResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageTokens", + methodName: "UsageTokensAsync", + pathTemplate: "\"/payment/usage/tokens\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageTokens", + methodName: "UsageTokensAsync", + pathTemplate: "\"/payment/usage/tokens\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessUsageTokensResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.g.cs new file mode 100644 index 00000000..d677c26b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Payment methods, usage tracking, and billing.
+ /// 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 BillingClient : global::DeepInfra.IBillingClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the BillingClient. + /// 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 BillingClient( + 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 BillingClient 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 BillingClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the BillingClient. + /// 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 BillingClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessages.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessages.g.cs new file mode 100644 index 00000000..4ac8b3b3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessages.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ChatCompletionsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_AnthropicMessagesSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_AnthropicMessagesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_AnthropicMessagesSecurityRequirement0, + }; + partial void PrepareAnthropicMessagesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xApiKey, + ref string? anthropicVersion, + ref string? anthropicBeta, + ref string? xDeepinfraSource, + global::DeepInfra.AnthropicMessagesIn request); + partial void PrepareAnthropicMessagesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xApiKey, + string? anthropicVersion, + string? anthropicBeta, + string? xDeepinfraSource, + global::DeepInfra.AnthropicMessagesIn request); + partial void ProcessAnthropicMessagesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnthropicMessagesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Anthropic Messages + /// + /// + /// + /// + /// + /// + /// 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 AnthropicMessagesAsync( + + global::DeepInfra.AnthropicMessagesIn request, + string? xApiKey = default, + string? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnthropicMessagesAsResponseAsync( + + request: request, + xApiKey: xApiKey, + anthropicVersion: anthropicVersion, + anthropicBeta: anthropicBeta, + xDeepinfraSource: xDeepinfraSource, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Anthropic Messages + /// + /// + /// + /// + /// + /// + /// 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> AnthropicMessagesAsResponseAsync( + + global::DeepInfra.AnthropicMessagesIn request, + string? xApiKey = default, + string? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAnthropicMessagesArguments( + httpClient: HttpClient, + xApiKey: ref xApiKey, + anthropicVersion: ref anthropicVersion, + anthropicBeta: ref anthropicBeta, + xDeepinfraSource: ref xDeepinfraSource, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnthropicMessagesSecurityRequirements, + operationName: "AnthropicMessagesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/anthropic/v1/messages", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + if (anthropicVersion != default) + { + __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); + } + if (anthropicBeta != default) + { + __httpRequest.Headers.TryAddWithoutValidation("anthropic-beta", anthropicBeta.ToString()); + } + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnthropicMessagesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xApiKey: xApiKey, + anthropicVersion: anthropicVersion, + anthropicBeta: anthropicBeta, + xDeepinfraSource: xDeepinfraSource, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnthropicMessages", + methodName: "AnthropicMessagesAsync", + pathTemplate: "\"/anthropic/v1/messages\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnthropicMessages", + methodName: "AnthropicMessagesAsync", + pathTemplate: "\"/anthropic/v1/messages\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnthropicMessages", + methodName: "AnthropicMessagesAsync", + pathTemplate: "\"/anthropic/v1/messages\"", + 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::DeepInfra.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); + ProcessAnthropicMessagesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnthropicMessages", + methodName: "AnthropicMessagesAsync", + pathTemplate: "\"/anthropic/v1/messages\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnthropicMessages", + methodName: "AnthropicMessagesAsync", + pathTemplate: "\"/anthropic/v1/messages\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessAnthropicMessagesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Anthropic Messages + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: false + /// + /// + /// Default Value: 1F + /// + /// + /// + /// + /// + /// + /// + /// 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 AnthropicMessagesAsync( + string model, + global::System.Collections.Generic.IList messages, + string? xApiKey = default, + string? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + int? maxTokens = default, + global::DeepInfra.AnyOf, object>? system = default, + global::System.Collections.Generic.IList? stopSequences = default, + bool? stream = default, + double? temperature = default, + double? topP = default, + int? topK = default, + object? metadata = default, + global::System.Collections.Generic.IList? tools = default, + object? toolChoice = default, + global::DeepInfra.AnthropicThinkingConfig? thinking = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.AnthropicMessagesIn + { + Model = model, + MaxTokens = maxTokens, + Messages = messages, + System = system, + StopSequences = stopSequences, + Stream = stream, + Temperature = temperature, + TopP = topP, + TopK = topK, + Metadata = metadata, + Tools = tools, + ToolChoice = toolChoice, + Thinking = thinking, + }; + + return await AnthropicMessagesAsync( + xApiKey: xApiKey, + anthropicVersion: anthropicVersion, + anthropicBeta: anthropicBeta, + xDeepinfraSource: xDeepinfraSource, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessagesCountTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessagesCountTokens.g.cs new file mode 100644 index 00000000..7c3e2ab1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessagesCountTokens.g.cs @@ -0,0 +1,523 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ChatCompletionsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_AnthropicMessagesCountTokensSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_AnthropicMessagesCountTokensSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_AnthropicMessagesCountTokensSecurityRequirement0, + }; + partial void PrepareAnthropicMessagesCountTokensArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xApiKey, + global::DeepInfra.AnthropicTokenCountRequest request); + partial void PrepareAnthropicMessagesCountTokensRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xApiKey, + global::DeepInfra.AnthropicTokenCountRequest request); + partial void ProcessAnthropicMessagesCountTokensResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAnthropicMessagesCountTokensResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Anthropic Messages Count Tokens + /// + /// + /// + /// 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 AnthropicMessagesCountTokensAsync( + + global::DeepInfra.AnthropicTokenCountRequest request, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnthropicMessagesCountTokensAsResponseAsync( + + request: request, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Anthropic Messages Count Tokens + /// + /// + /// + /// 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> AnthropicMessagesCountTokensAsResponseAsync( + + global::DeepInfra.AnthropicTokenCountRequest request, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAnthropicMessagesCountTokensArguments( + httpClient: HttpClient, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AnthropicMessagesCountTokensSecurityRequirements, + operationName: "AnthropicMessagesCountTokensAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/anthropic/v1/messages/count_tokens", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAnthropicMessagesCountTokensRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xApiKey: xApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnthropicMessagesCountTokens", + methodName: "AnthropicMessagesCountTokensAsync", + pathTemplate: "\"/anthropic/v1/messages/count_tokens\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnthropicMessagesCountTokens", + methodName: "AnthropicMessagesCountTokensAsync", + pathTemplate: "\"/anthropic/v1/messages/count_tokens\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnthropicMessagesCountTokens", + methodName: "AnthropicMessagesCountTokensAsync", + pathTemplate: "\"/anthropic/v1/messages/count_tokens\"", + 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::DeepInfra.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); + ProcessAnthropicMessagesCountTokensResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnthropicMessagesCountTokens", + methodName: "AnthropicMessagesCountTokensAsync", + pathTemplate: "\"/anthropic/v1/messages/count_tokens\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AnthropicMessagesCountTokens", + methodName: "AnthropicMessagesCountTokensAsync", + pathTemplate: "\"/anthropic/v1/messages/count_tokens\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessAnthropicMessagesCountTokensResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Anthropic Messages Count Tokens + /// + /// + /// + /// + /// + /// + /// + /// + /// 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 AnthropicMessagesCountTokensAsync( + string model, + global::System.Collections.Generic.IList messages, + string? xApiKey = default, + global::DeepInfra.AnyOf, object>? system = default, + global::System.Collections.Generic.IList? tools = default, + global::DeepInfra.AnthropicThinkingConfig? thinking = default, + object? toolChoice = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.AnthropicTokenCountRequest + { + Model = model, + Messages = messages, + System = system, + Tools = tools, + Thinking = thinking, + ToolChoice = toolChoice, + }; + + return await AnthropicMessagesCountTokensAsync( + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.OpenaiChatCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.OpenaiChatCompletions.g.cs new file mode 100644 index 00000000..e2857bee --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.OpenaiChatCompletions.g.cs @@ -0,0 +1,661 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ChatCompletionsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiChatCompletionsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiChatCompletionsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiChatCompletionsSecurityRequirement0, + }; + partial void PrepareOpenaiChatCompletionsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xDeepinfraSource, + ref string? xiApiKey, + global::DeepInfra.OpenAIChatCompletionsIn request); + partial void PrepareOpenaiChatCompletionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? xiApiKey, + global::DeepInfra.OpenAIChatCompletionsIn request); + partial void ProcessOpenaiChatCompletionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiChatCompletionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Chat Completions + /// + /// + /// + /// + /// 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 OpenaiChatCompletionsAsync( + + global::DeepInfra.OpenAIChatCompletionsIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiChatCompletionsAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Chat Completions + /// + /// + /// + /// + /// 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> OpenaiChatCompletionsAsResponseAsync( + + global::DeepInfra.OpenAIChatCompletionsIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenaiChatCompletionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiChatCompletionsSecurityRequirements, + operationName: "OpenaiChatCompletionsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/chat/completions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiChatCompletionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiChatCompletions", + methodName: "OpenaiChatCompletionsAsync", + pathTemplate: "\"/v1/chat/completions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiChatCompletions", + methodName: "OpenaiChatCompletionsAsync", + pathTemplate: "\"/v1/chat/completions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiChatCompletions", + methodName: "OpenaiChatCompletionsAsync", + pathTemplate: "\"/v1/chat/completions\"", + 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::DeepInfra.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); + ProcessOpenaiChatCompletionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiChatCompletions", + methodName: "OpenaiChatCompletionsAsync", + pathTemplate: "\"/v1/chat/completions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiChatCompletions", + methodName: "OpenaiChatCompletionsAsync", + pathTemplate: "\"/v1/chat/completions\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiChatCompletionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Chat Completions + /// + /// + /// + /// + /// model name + /// + /// + /// conversation messages: (user,assistant,tool)*,user including one system message anywhere + /// + /// + /// whether to stream the output via SSE or return the full response
+ /// Default Value: false + /// + /// + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
+ /// Default Value: 1F + /// + /// + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
+ /// Default Value: 1F + /// + /// + /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
+ /// Default Value: 0F + /// + /// + /// Sample from the best k (number of) tokens. 0 means off
+ /// Default Value: 0 + /// + /// + /// The maximum number of tokens to generate in the chat completion.
+ /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. + /// + /// + /// up to 16 sequences where the API will stop generating further tokens + /// + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + /// + /// number of sequences to return
+ /// Default Value: 1 + /// + /// + /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// A list of tools the model may call. Currently, only functions are supported as a tool. + /// + /// + /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. + /// + /// + /// The format of the response. Currently, only json is supported. + /// + /// + /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
+ /// Default Value: 1 + /// + /// + /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. + /// + /// + /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. + /// + /// + /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. + /// + /// + /// streaming options + /// + /// + /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. + /// + /// + /// Reasoning configuration. + /// + /// + /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. + /// + /// + /// Chat template kwargs. + /// + /// + /// If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message. + /// + /// 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 OpenaiChatCompletionsAsync( + string model, + global::System.Collections.Generic.IList> messages, + string? xDeepinfraSource = default, + string? xiApiKey = default, + bool? stream = default, + double? temperature = default, + double? topP = default, + double? minP = default, + int? topK = default, + int? maxTokens = default, + global::DeepInfra.AnyOf, object>? stop = default, + global::System.Collections.Generic.IList? stopTokenIds = default, + int? n = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.IList? tools = default, + global::DeepInfra.AnyOf? toolChoice = default, + global::DeepInfra.AnyOf? responseFormat = default, + double? repetitionPenalty = default, + string? user = default, + int? seed = default, + bool? logprobs = default, + global::DeepInfra.StreamOptions? streamOptions = default, + global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, + global::DeepInfra.ChatReasoningSettings? reasoning = default, + string? promptCacheKey = default, + object? chatTemplateKwargs = default, + bool? continueFinalMessage = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAIChatCompletionsIn + { + Model = model, + Messages = messages, + Stream = stream, + Temperature = temperature, + TopP = topP, + MinP = minP, + TopK = topK, + MaxTokens = maxTokens, + Stop = stop, + StopTokenIds = stopTokenIds, + N = n, + PresencePenalty = presencePenalty, + FrequencyPenalty = frequencyPenalty, + Tools = tools, + ToolChoice = toolChoice, + ResponseFormat = responseFormat, + RepetitionPenalty = repetitionPenalty, + User = user, + Seed = seed, + Logprobs = logprobs, + StreamOptions = streamOptions, + ReasoningEffort = reasoningEffort, + Reasoning = reasoning, + PromptCacheKey = promptCacheKey, + ChatTemplateKwargs = chatTemplateKwargs, + ContinueFinalMessage = continueFinalMessage, + }; + + return await OpenaiChatCompletionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.g.cs new file mode 100644 index 00000000..43f1ad72 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI and Anthropic-compatible chat completion endpoints for LLMs.
+ /// 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 ChatCompletionsClient : global::DeepInfra.IChatCompletionsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ChatCompletionsClient. + /// 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 ChatCompletionsClient( + 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 ChatCompletionsClient 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 ChatCompletionsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ChatCompletionsClient. + /// 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 ChatCompletionsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreate.g.cs new file mode 100644 index 00000000..9c681269 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreate.g.cs @@ -0,0 +1,636 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployCreateSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployCreateSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployCreateSecurityRequirement0, + }; + partial void PrepareDeployCreateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.DeployModelIn request); + partial void PrepareDeployCreateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.DeployModelIn request); + partial void ProcessDeployCreateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployCreateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Create + /// + /// + /// + /// 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 DeployCreateAsync( + + global::DeepInfra.DeployModelIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployCreateAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Create + /// + /// + /// + /// 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> DeployCreateAsResponseAsync( + + global::DeepInfra.DeployModelIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDeployCreateArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployCreateSecurityRequirements, + operationName: "DeployCreateAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/deploy", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployCreateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreate", + methodName: "DeployCreateAsync", + pathTemplate: "\"/v1/deploy\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreate", + methodName: "DeployCreateAsync", + pathTemplate: "\"/v1/deploy\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreate", + methodName: "DeployCreateAsync", + pathTemplate: "\"/v1/deploy\"", + 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::DeepInfra.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); + ProcessDeployCreateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreate", + methodName: "DeployCreateAsync", + pathTemplate: "\"/v1/deploy\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreate", + methodName: "DeployCreateAsync", + pathTemplate: "\"/v1/deploy\"", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Locked + if ((int)__response.StatusCode == 423) + { + string? __content_423 = null; + global::System.Exception? __exception_423 = null; + global::DeepInfra.DeepError? __value_423 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_423 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); + } + else + { + __content_423 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_423 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_423, + responseBody: __content_423, + responseObject: __value_423, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployCreateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeployResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeployResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Deploy Create + /// + /// + /// + /// namespace for the model name
+ /// Default Value: cnt + /// + /// + /// model name in specified provider + /// + /// + /// A specific revision, if left empty uses the last one + /// + /// 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 DeployCreateAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.ModelProvider? provider = default, + string? version = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.DeployModelIn + { + Provider = provider, + ModelName = modelName, + Version = version, + }; + + return await DeployCreateAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreateHf.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreateHf.g.cs new file mode 100644 index 00000000..37540282 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreateHf.g.cs @@ -0,0 +1,630 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployCreateHfSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployCreateHfSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployCreateHfSecurityRequirement0, + }; + partial void PrepareDeployCreateHfArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.HFModel request); + partial void PrepareDeployCreateHfRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.HFModel request); + partial void ProcessDeployCreateHfResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployCreateHfResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Create Hf + /// + /// + /// + /// 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 DeployCreateHfAsync( + + global::DeepInfra.HFModel request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployCreateHfAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Create Hf + /// + /// + /// + /// 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> DeployCreateHfAsResponseAsync( + + global::DeepInfra.HFModel request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDeployCreateHfArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployCreateHfSecurityRequirements, + operationName: "DeployCreateHfAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/deploy/hf/", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployCreateHfRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreateHf", + methodName: "DeployCreateHfAsync", + pathTemplate: "\"/deploy/hf/\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreateHf", + methodName: "DeployCreateHfAsync", + pathTemplate: "\"/deploy/hf/\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreateHf", + methodName: "DeployCreateHfAsync", + pathTemplate: "\"/deploy/hf/\"", + 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::DeepInfra.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); + ProcessDeployCreateHfResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreateHf", + methodName: "DeployCreateHfAsync", + pathTemplate: "\"/deploy/hf/\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreateHf", + methodName: "DeployCreateHfAsync", + pathTemplate: "\"/deploy/hf/\"", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Locked + if ((int)__response.StatusCode == 423) + { + string? __content_423 = null; + global::System.Exception? __exception_423 = null; + global::DeepInfra.DeepError? __value_423 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_423 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); + } + else + { + __content_423 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_423 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_423, + responseBody: __content_423, + responseObject: __value_423, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployCreateHfResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeployResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeployResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Deploy Create Hf + /// + /// + /// + /// Model Id from huggingface + /// + /// + /// Task + /// + /// 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 DeployCreateHfAsync( + string modelName, + string? xiApiKey = default, + string? task = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.HFModel + { + ModelName = modelName, + Task = task, + }; + + return await DeployCreateHfAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreateLlm.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreateLlm.g.cs new file mode 100644 index 00000000..9e9589eb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreateLlm.g.cs @@ -0,0 +1,626 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployCreateLlmSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployCreateLlmSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployCreateLlmSecurityRequirement0, + }; + partial void PrepareDeployCreateLlmArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.DeployLLMIn request); + partial void PrepareDeployCreateLlmRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.DeployLLMIn request); + partial void ProcessDeployCreateLlmResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployCreateLlmResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Create Llm + /// + /// + /// + /// 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 DeployCreateLlmAsync( + + global::DeepInfra.DeployLLMIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployCreateLlmAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Create Llm + /// + /// + /// + /// 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> DeployCreateLlmAsResponseAsync( + + global::DeepInfra.DeployLLMIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDeployCreateLlmArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployCreateLlmSecurityRequirements, + operationName: "DeployCreateLlmAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/deploy/llm", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployCreateLlmRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreateLlm", + methodName: "DeployCreateLlmAsync", + pathTemplate: "\"/deploy/llm\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreateLlm", + methodName: "DeployCreateLlmAsync", + pathTemplate: "\"/deploy/llm\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreateLlm", + methodName: "DeployCreateLlmAsync", + pathTemplate: "\"/deploy/llm\"", + 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::DeepInfra.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); + ProcessDeployCreateLlmResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreateLlm", + methodName: "DeployCreateLlmAsync", + pathTemplate: "\"/deploy/llm\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployCreateLlm", + methodName: "DeployCreateLlmAsync", + pathTemplate: "\"/deploy/llm\"", + 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); + } + // Payment Required + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::DeepInfra.DeepError? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::DeepInfra.DeepError.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::DeepInfra.DeepError.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unprocessable Entity + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.DeepError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployCreateLlmResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Deploy Create Llm + /// + /// + /// + /// model name for deepinfra (username/mode-name format) + /// + /// + /// The type of GPU the deployment is running on + /// + /// + /// Number of GPUs used by one instance
+ /// Default Value: 1 + /// + /// + /// Maximum number of concurrent requests
+ /// Default Value: 96 + /// + /// + /// + /// Base public model + /// + /// + /// Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4) + /// + /// + /// + /// Extra command line arguments for custom deployments + /// + /// 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 DeployCreateLlmAsync( + string modelName, + global::DeepInfra.DeployGPUs gpu, + string? xiApiKey = default, + int? numGpus = default, + int? maxBatchSize = default, + global::DeepInfra.HFWeights? hf = default, + string? baseModel = default, + string? containerImage = default, + global::DeepInfra.ScaleSettings? settings = default, + global::System.Collections.Generic.IList? extraArgs = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.DeployLLMIn + { + ModelName = modelName, + Gpu = gpu, + NumGpus = numGpus, + MaxBatchSize = maxBatchSize, + Hf = hf, + BaseModel = baseModel, + ContainerImage = containerImage, + Settings = settings, + ExtraArgs = extraArgs, + }; + + return await DeployCreateLlmAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployDelete.g.cs new file mode 100644 index 00000000..d2989a15 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployDelete.g.cs @@ -0,0 +1,513 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployDeleteSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployDeleteSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployDeleteSecurityRequirement0, + }; + partial void PrepareDeployDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? xiApiKey); + partial void PrepareDeployDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey); + partial void ProcessDeployDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployDeleteResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Delete + /// + /// + /// + /// 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 DeployDeleteAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployDeleteAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Delete + /// + /// + /// + /// 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> DeployDeleteAsResponseAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployDeleteArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployDeleteSecurityRequirements, + operationName: "DeployDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/deploy/{deployId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployDelete", + methodName: "DeployDeleteAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployDelete", + methodName: "DeployDeleteAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployDelete", + methodName: "DeployDeleteAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "DELETE", + 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::DeepInfra.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); + ProcessDeployDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployDelete", + methodName: "DeployDeleteAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployDelete", + methodName: "DeployDeleteAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "DELETE", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeployDelete.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeployDelete.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployDetailedStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployDetailedStats.g.cs new file mode 100644 index 00000000..27f351cd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployDetailedStats.g.cs @@ -0,0 +1,582 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployDetailedStatsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployDetailedStatsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployDetailedStatsSecurityRequirement0, + }; + partial void PrepareDeployDetailedStatsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string from, + ref string? to, + ref string? xiApiKey); + partial void PrepareDeployDetailedStatsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string from, + string? to, + string? xiApiKey); + partial void ProcessDeployDetailedStatsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployDetailedStatsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Detailed Stats + /// + /// + /// + /// start of period, unix ts or 'now-5h', supported units s, m, h, d, w + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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 DeployDetailedStatsAsync( + string deployId, + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployDetailedStatsAsResponseAsync( + deployId: deployId, + from: from, + to: to, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Detailed Stats + /// + /// + /// + /// start of period, unix ts or 'now-5h', supported units s, m, h, d, w + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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> DeployDetailedStatsAsResponseAsync( + string deployId, + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployDetailedStatsArguments( + httpClient: HttpClient, + deployId: ref deployId, + from: ref from, + to: ref to, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployDetailedStatsSecurityRequirements, + operationName: "DeployDetailedStatsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/deploy/{deployId}/stats2", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from) + .AddOptionalParameter("to", to) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployDetailedStatsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + from: from!, + to: to, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployDetailedStats", + methodName: "DeployDetailedStatsAsync", + pathTemplate: "$\"/deploy/{deployId}/stats2\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployDetailedStats", + methodName: "DeployDetailedStatsAsync", + pathTemplate: "$\"/deploy/{deployId}/stats2\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployDetailedStats", + methodName: "DeployDetailedStatsAsync", + pathTemplate: "$\"/deploy/{deployId}/stats2\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessDeployDetailedStatsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployDetailedStats", + methodName: "DeployDetailedStatsAsync", + pathTemplate: "$\"/deploy/{deployId}/stats2\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployDetailedStats", + methodName: "DeployDetailedStatsAsync", + pathTemplate: "$\"/deploy/{deployId}/stats2\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Gone + if ((int)__response.StatusCode == 410) + { + string? __content_410 = null; + global::System.Exception? __exception_410 = null; + global::DeepInfra.DeepError? __value_410 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_410 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); + } + else + { + __content_410 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_410 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_410 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_410, + responseBody: __content_410, + responseObject: __value_410, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployDetailedStatsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DetailedDeploymentStatsOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DetailedDeploymentStatsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployGpuAvailability.g.cs new file mode 100644 index 00000000..32da9665 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployGpuAvailability.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployGpuAvailabilitySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployGpuAvailabilitySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployGpuAvailabilitySecurityRequirement0, + }; + partial void PrepareDeployGpuAvailabilityArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? source, + ref string? baseModel, + ref string? xiApiKey); + partial void PrepareDeployGpuAvailabilityRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? source, + string? baseModel, + string? xiApiKey); + partial void ProcessDeployGpuAvailabilityResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployGpuAvailabilityResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Gpu Availability + /// + /// + /// + /// + /// 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 DeployGpuAvailabilityAsync( + string? source = default, + string? baseModel = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployGpuAvailabilityAsResponseAsync( + source: source, + baseModel: baseModel, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Gpu Availability + /// + /// + /// + /// + /// 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> DeployGpuAvailabilityAsResponseAsync( + string? source = default, + string? baseModel = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployGpuAvailabilityArguments( + httpClient: HttpClient, + source: ref source, + baseModel: ref baseModel, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployGpuAvailabilitySecurityRequirements, + operationName: "DeployGpuAvailabilityAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/deploy/llm/gpu_availability", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("source", source) + .AddOptionalParameter("base_model", baseModel) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployGpuAvailabilityRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + source: source, + baseModel: baseModel, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployGpuAvailability", + methodName: "DeployGpuAvailabilityAsync", + pathTemplate: "\"/deploy/llm/gpu_availability\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployGpuAvailability", + methodName: "DeployGpuAvailabilityAsync", + pathTemplate: "\"/deploy/llm/gpu_availability\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployGpuAvailability", + methodName: "DeployGpuAvailabilityAsync", + pathTemplate: "\"/deploy/llm/gpu_availability\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessDeployGpuAvailabilityResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployGpuAvailability", + methodName: "DeployGpuAvailabilityAsync", + pathTemplate: "\"/deploy/llm/gpu_availability\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployGpuAvailability", + methodName: "DeployGpuAvailabilityAsync", + pathTemplate: "\"/deploy/llm/gpu_availability\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployGpuAvailabilityResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeployGPUAvailability.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeployGPUAvailability.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployList2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployList2.g.cs new file mode 100644 index 00000000..c7da0e66 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployList2.g.cs @@ -0,0 +1,520 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployList2SecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployList2SecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployList2SecurityRequirement0, + }; + partial void PrepareDeployList2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string? status, + ref string? xiApiKey); + partial void PrepareDeployList2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? status, + string? xiApiKey); + partial void ProcessDeployList2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployList2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy List + /// + /// + /// A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted + /// + /// + /// 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> DeployList2Async( + string? status = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployList2AsResponseAsync( + status: status, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy List + /// + /// + /// A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted + /// + /// + /// 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>> DeployList2AsResponseAsync( + string? status = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployList2Arguments( + httpClient: HttpClient, + status: ref status, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployList2SecurityRequirements, + operationName: "DeployList2Async"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/deploy/list", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("status", status) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployList2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + status: status, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployList2", + methodName: "DeployList2Async", + pathTemplate: "\"/deploy/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployList2", + methodName: "DeployList2Async", + pathTemplate: "\"/deploy/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployList2", + methodName: "DeployList2Async", + pathTemplate: "\"/deploy/list\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessDeployList2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployList2", + methodName: "DeployList2Async", + pathTemplate: "\"/deploy/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployList2", + methodName: "DeployList2Async", + pathTemplate: "\"/deploy/list\"", + httpMethod: "GET", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployList2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployLlmSuggestName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployLlmSuggestName.g.cs new file mode 100644 index 00000000..6de811f1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployLlmSuggestName.g.cs @@ -0,0 +1,516 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployLlmSuggestNameSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployLlmSuggestNameSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployLlmSuggestNameSecurityRequirement0, + }; + partial void PrepareDeployLlmSuggestNameArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelName, + ref string? xiApiKey); + partial void PrepareDeployLlmSuggestNameRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? xiApiKey); + partial void ProcessDeployLlmSuggestNameResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployLlmSuggestNameResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Llm Suggest Name + /// + /// + /// + /// 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 DeployLlmSuggestNameAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployLlmSuggestNameAsResponseAsync( + modelName: modelName, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Llm Suggest Name + /// + /// + /// + /// 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> DeployLlmSuggestNameAsResponseAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployLlmSuggestNameArguments( + httpClient: HttpClient, + modelName: ref modelName, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployLlmSuggestNameSecurityRequirements, + operationName: "DeployLlmSuggestNameAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/deploy/llm/suggest_name", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("model_name", modelName) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployLlmSuggestNameRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployLlmSuggestName", + methodName: "DeployLlmSuggestNameAsync", + pathTemplate: "\"/deploy/llm/suggest_name\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployLlmSuggestName", + methodName: "DeployLlmSuggestNameAsync", + pathTemplate: "\"/deploy/llm/suggest_name\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployLlmSuggestName", + methodName: "DeployLlmSuggestNameAsync", + pathTemplate: "\"/deploy/llm/suggest_name\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessDeployLlmSuggestNameResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployLlmSuggestName", + methodName: "DeployLlmSuggestNameAsync", + pathTemplate: "\"/deploy/llm/suggest_name\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployLlmSuggestName", + methodName: "DeployLlmSuggestNameAsync", + pathTemplate: "\"/deploy/llm/suggest_name\"", + httpMethod: "GET", + 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); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployLlmSuggestNameResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ModelNameSuggestionOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.ModelNameSuggestionOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStart.g.cs new file mode 100644 index 00000000..d2f638c4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStart.g.cs @@ -0,0 +1,552 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployStartSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployStartSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployStartSecurityRequirement0, + }; + partial void PrepareDeployStartArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? xiApiKey); + partial void PrepareDeployStartRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey); + partial void ProcessDeployStartResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployStartResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Start
+ /// Start a stopped deployment. Re-creates pods via auto-scaling. + ///
+ /// + /// + /// 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 DeployStartAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployStartAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Start
+ /// Start a stopped deployment. Re-creates pods via auto-scaling. + ///
+ /// + /// + /// 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> DeployStartAsResponseAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployStartArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployStartSecurityRequirements, + operationName: "DeployStartAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/deploy/{deployId}/start", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployStartRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStart", + methodName: "DeployStartAsync", + pathTemplate: "$\"/deploy/{deployId}/start\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStart", + methodName: "DeployStartAsync", + pathTemplate: "$\"/deploy/{deployId}/start\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStart", + methodName: "DeployStartAsync", + pathTemplate: "$\"/deploy/{deployId}/start\"", + 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::DeepInfra.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); + ProcessDeployStartResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStart", + methodName: "DeployStartAsync", + pathTemplate: "$\"/deploy/{deployId}/start\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStart", + methodName: "DeployStartAsync", + pathTemplate: "$\"/deploy/{deployId}/start\"", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployStartResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeployStatusOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeployStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStats.g.cs new file mode 100644 index 00000000..3a5aa4c8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStats.g.cs @@ -0,0 +1,582 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployStatsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployStatsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployStatsSecurityRequirement0, + }; + partial void PrepareDeployStatsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string from, + ref string? to, + ref string? xiApiKey); + partial void PrepareDeployStatsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string from, + string? to, + string? xiApiKey); + partial void ProcessDeployStatsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployStatsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Stats + /// + /// + /// + /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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 DeployStatsAsync( + string deployId, + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployStatsAsResponseAsync( + deployId: deployId, + from: from, + to: to, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Stats + /// + /// + /// + /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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> DeployStatsAsResponseAsync( + string deployId, + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployStatsArguments( + httpClient: HttpClient, + deployId: ref deployId, + from: ref from, + to: ref to, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployStatsSecurityRequirements, + operationName: "DeployStatsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/deploy/{deployId}/stats", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from) + .AddOptionalParameter("to", to) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployStatsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + from: from!, + to: to, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStats", + methodName: "DeployStatsAsync", + pathTemplate: "$\"/deploy/{deployId}/stats\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStats", + methodName: "DeployStatsAsync", + pathTemplate: "$\"/deploy/{deployId}/stats\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStats", + methodName: "DeployStatsAsync", + pathTemplate: "$\"/deploy/{deployId}/stats\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessDeployStatsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStats", + methodName: "DeployStatsAsync", + pathTemplate: "$\"/deploy/{deployId}/stats\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStats", + methodName: "DeployStatsAsync", + pathTemplate: "$\"/deploy/{deployId}/stats\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Gone + if ((int)__response.StatusCode == 410) + { + string? __content_410 = null; + global::System.Exception? __exception_410 = null; + global::DeepInfra.DeepError? __value_410 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_410 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); + } + else + { + __content_410 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_410 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_410 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_410, + responseBody: __content_410, + responseObject: __value_410, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployStatsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeploymentStatsOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeploymentStatsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStatus.g.cs new file mode 100644 index 00000000..66ce7189 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStatus.g.cs @@ -0,0 +1,513 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployStatusSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployStatusSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployStatusSecurityRequirement0, + }; + partial void PrepareDeployStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? xiApiKey); + partial void PrepareDeployStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey); + partial void ProcessDeployStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Status + /// + /// + /// + /// 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 DeployStatusAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployStatusAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Status + /// + /// + /// + /// 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> DeployStatusAsResponseAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployStatusArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployStatusSecurityRequirements, + operationName: "DeployStatusAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/deploy/{deployId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStatus", + methodName: "DeployStatusAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStatus", + methodName: "DeployStatusAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStatus", + methodName: "DeployStatusAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessDeployStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStatus", + methodName: "DeployStatusAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStatus", + methodName: "DeployStatusAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStop.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStop.g.cs new file mode 100644 index 00000000..65246c1c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStop.g.cs @@ -0,0 +1,552 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployStopSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployStopSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployStopSecurityRequirement0, + }; + partial void PrepareDeployStopArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? xiApiKey); + partial void PrepareDeployStopRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey); + partial void ProcessDeployStopResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployStopResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Stop
+ /// Stop a running deployment. Terminates pods. Can be restarted later. + ///
+ /// + /// + /// 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 DeployStopAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployStopAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Stop
+ /// Stop a running deployment. Terminates pods. Can be restarted later. + ///
+ /// + /// + /// 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> DeployStopAsResponseAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployStopArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployStopSecurityRequirements, + operationName: "DeployStopAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/deploy/{deployId}/stop", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployStopRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStop", + methodName: "DeployStopAsync", + pathTemplate: "$\"/deploy/{deployId}/stop\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStop", + methodName: "DeployStopAsync", + pathTemplate: "$\"/deploy/{deployId}/stop\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStop", + methodName: "DeployStopAsync", + pathTemplate: "$\"/deploy/{deployId}/stop\"", + 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::DeepInfra.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); + ProcessDeployStopResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStop", + methodName: "DeployStopAsync", + pathTemplate: "$\"/deploy/{deployId}/stop\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployStop", + methodName: "DeployStopAsync", + pathTemplate: "$\"/deploy/{deployId}/stop\"", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployStopResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeployStatusOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeployStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployUpdate.g.cs new file mode 100644 index 00000000..e6e9d8cd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployUpdate.g.cs @@ -0,0 +1,635 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployUpdateSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeployUpdateSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployUpdateSecurityRequirement0, + }; + partial void PrepareDeployUpdateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? xiApiKey, + global::DeepInfra.DeployLLMUpdateIn request); + partial void PrepareDeployUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + global::DeepInfra.DeployLLMUpdateIn request); + partial void ProcessDeployUpdateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployUpdateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Update + /// + /// + /// + /// + /// 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 DeployUpdateAsync( + string deployId, + + global::DeepInfra.DeployLLMUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployUpdateAsResponseAsync( + deployId: deployId, + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Update + /// + /// + /// + /// + /// 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> DeployUpdateAsResponseAsync( + string deployId, + + global::DeepInfra.DeployLLMUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDeployUpdateArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployUpdateSecurityRequirements, + operationName: "DeployUpdateAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/deploy/{deployId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Put, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployUpdate", + methodName: "DeployUpdateAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "PUT", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployUpdate", + methodName: "DeployUpdateAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "PUT", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployUpdate", + methodName: "DeployUpdateAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "PUT", + 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::DeepInfra.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); + ProcessDeployUpdateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployUpdate", + methodName: "DeployUpdateAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "PUT", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployUpdate", + methodName: "DeployUpdateAsync", + pathTemplate: "$\"/deploy/{deployId}\"", + httpMethod: "PUT", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeployUpdateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeployStatusOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeployStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Deploy Update + /// + /// + /// + /// + /// 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 DeployUpdateAsync( + string deployId, + global::DeepInfra.ScaleSettings settings, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.DeployLLMUpdateIn + { + Settings = settings, + }; + + return await DeployUpdateAsync( + deployId: deployId, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeploymentStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeploymentStats.g.cs new file mode 100644 index 00000000..8b888e16 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeploymentStats.g.cs @@ -0,0 +1,499 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeploymentStatsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeploymentStatsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeploymentStatsSecurityRequirement0, + }; + partial void PrepareDeploymentStatsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string from, + ref string? to, + ref string? xiApiKey); + partial void PrepareDeploymentStatsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string from, + string? to, + string? xiApiKey); + partial void ProcessDeploymentStatsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentStatsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deployment Stats + /// + /// + /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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> DeploymentStatsAsync( + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentStatsAsResponseAsync( + from: from, + to: to, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deployment Stats + /// + /// + /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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>> DeploymentStatsAsResponseAsync( + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeploymentStatsArguments( + httpClient: HttpClient, + from: ref from, + to: ref to, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentStatsSecurityRequirements, + operationName: "DeploymentStatsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/deploy/stats", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from) + .AddOptionalParameter("to", to) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentStatsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + from: from!, + to: to, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentStats", + methodName: "DeploymentStatsAsync", + pathTemplate: "\"/deploy/stats\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentStats", + methodName: "DeploymentStatsAsync", + pathTemplate: "\"/deploy/stats\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentStats", + methodName: "DeploymentStatsAsync", + pathTemplate: "\"/deploy/stats\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessDeploymentStatsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentStats", + methodName: "DeploymentStatsAsync", + pathTemplate: "\"/deploy/stats\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentStats", + methodName: "DeploymentStatsAsync", + pathTemplate: "\"/deploy/stats\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeploymentStatsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.g.cs new file mode 100644 index 00000000..bfbf70a8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Deploy and manage private model instances with autoscaling.
+ /// 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 DedicatedModelsClient : global::DeepInfra.IDedicatedModelsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the DedicatedModelsClient. + /// 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 DedicatedModelsClient( + 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 DedicatedModelsClient 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 DedicatedModelsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the DedicatedModelsClient. + /// 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 DedicatedModelsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountEmailValues.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountEmailValues.g.cs deleted file mode 100644 index 133652e9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountEmailValues.g.cs +++ /dev/null @@ -1,256 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAccountEmailValuesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareAccountEmailValuesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessAccountEmailValuesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAccountEmailValuesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Account Email Values - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AccountEmailValuesAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareAccountEmailValuesArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/emails", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAccountEmailValuesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAccountEmailValuesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAccountEmailValuesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.EmailsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.EmailsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountGpuLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountGpuLimit.g.cs deleted file mode 100644 index 4a7183f6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountGpuLimit.g.cs +++ /dev/null @@ -1,256 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAccountGpuLimitArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareAccountGpuLimitRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessAccountGpuLimitResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAccountGpuLimitResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Account Gpu Limit - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AccountGpuLimitAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareAccountGpuLimitArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/gpu_limit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAccountGpuLimitRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAccountGpuLimitResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAccountGpuLimitResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.GpuLimitOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.GpuLimitOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountRateLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountRateLimit.g.cs deleted file mode 100644 index 8f06b093..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountRateLimit.g.cs +++ /dev/null @@ -1,256 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAccountRateLimitArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareAccountRateLimitRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessAccountRateLimitResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAccountRateLimitResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Account Rate Limit - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AccountRateLimitAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareAccountRateLimitArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/rate_limit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAccountRateLimitRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAccountRateLimitResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAccountRateLimitResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.RateLimitOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.RateLimitOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountUpdateDetails.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountUpdateDetails.g.cs deleted file mode 100644 index e0838050..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountUpdateDetails.g.cs +++ /dev/null @@ -1,380 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAccountUpdateDetailsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.MeIn request); - partial void PrepareAccountUpdateDetailsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.MeIn request); - partial void ProcessAccountUpdateDetailsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAccountUpdateDetailsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Account Update Details - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AccountUpdateDetailsAsync( - - global::DeepInfra.MeIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareAccountUpdateDetailsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAccountUpdateDetailsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAccountUpdateDetailsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unprocessable Entity - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.DeepError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAccountUpdateDetailsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Account Update Details - /// - /// - /// - /// Personal name - /// - /// - /// First name of the user - /// - /// - /// Last name of the user - /// - /// - /// Country of the user - /// - /// - /// - /// - /// Company name - /// - /// - /// Company website address - /// - /// - /// Job title of the user, e.g. 'Software Engineer' - /// - /// - /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. - /// - /// - /// Short description of the use case for the account - /// - /// - /// Short description of how the user found out about DeepInfra - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AccountUpdateDetailsAsync( - string? xiApiKey = default, - string? name = default, - string? firstName = default, - string? lastName = default, - string? country = default, - string? email = default, - bool? isBusinessAccount = default, - string? company = default, - string? website = default, - string? title = default, - string? displayName = default, - string? useCase = default, - string? attribution = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.MeIn - { - Name = name, - FirstName = firstName, - LastName = lastName, - Country = country, - Email = email, - IsBusinessAccount = isBusinessAccount, - Company = company, - Website = website, - Title = title, - DisplayName = displayName, - UseCase = useCase, - Attribution = attribution, - }; - - return await AccountUpdateDetailsAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AddFunds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AddFunds.g.cs deleted file mode 100644 index 9fd77666..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AddFunds.g.cs +++ /dev/null @@ -1,247 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAddFundsArguments( - global::System.Net.Http.HttpClient httpClient, - object? session, - global::DeepInfra.AddFundsIn request); - partial void PrepareAddFundsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - object? session, - global::DeepInfra.AddFundsIn request); - partial void ProcessAddFundsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAddFundsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Add Funds - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AddFundsAsync( - - global::DeepInfra.AddFundsIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareAddFundsArguments( - httpClient: HttpClient, - session: session, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/funds", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAddFundsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - session: session, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAddFundsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAddFundsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Add Funds - /// - /// - /// - /// Amount to add in cents - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AddFundsAsync( - int amount, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.AddFundsIn - { - Amount = amount, - }; - - return await AddFundsAsync( - session: session, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessages.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessages.g.cs deleted file mode 100644 index cf2d9c1a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessages.g.cs +++ /dev/null @@ -1,330 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAnthropicMessagesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xApiKey, - ref string? anthropicVersion, - ref string? anthropicBeta, - ref string? xDeepinfraSource, - global::DeepInfra.AnthropicMessagesIn request); - partial void PrepareAnthropicMessagesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xApiKey, - string? anthropicVersion, - string? anthropicBeta, - string? xDeepinfraSource, - global::DeepInfra.AnthropicMessagesIn request); - partial void ProcessAnthropicMessagesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAnthropicMessagesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Anthropic Messages - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AnthropicMessagesAsync( - - global::DeepInfra.AnthropicMessagesIn request, - string? xApiKey = default, - string? anthropicVersion = default, - string? anthropicBeta = default, - string? xDeepinfraSource = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareAnthropicMessagesArguments( - httpClient: HttpClient, - xApiKey: ref xApiKey, - anthropicVersion: ref anthropicVersion, - anthropicBeta: ref anthropicBeta, - xDeepinfraSource: ref xDeepinfraSource, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/anthropic/v1/messages", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); - } - if (anthropicVersion != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); - } - if (anthropicBeta != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-beta", anthropicBeta.ToString()); - } - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAnthropicMessagesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xApiKey: xApiKey, - anthropicVersion: anthropicVersion, - anthropicBeta: anthropicBeta, - xDeepinfraSource: xDeepinfraSource, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAnthropicMessagesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAnthropicMessagesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Anthropic Messages - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: false - /// - /// - /// Default Value: 1F - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AnthropicMessagesAsync( - string model, - global::System.Collections.Generic.IList messages, - string? xApiKey = default, - string? anthropicVersion = default, - string? anthropicBeta = default, - string? xDeepinfraSource = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? system = default, - global::System.Collections.Generic.IList? stopSequences = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - int? topK = default, - object? metadata = default, - global::System.Collections.Generic.IList? tools = default, - object? toolChoice = default, - global::DeepInfra.AnthropicThinkingConfig? thinking = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.AnthropicMessagesIn - { - Model = model, - MaxTokens = maxTokens, - Messages = messages, - System = system, - StopSequences = stopSequences, - Stream = stream, - Temperature = temperature, - TopP = topP, - TopK = topK, - Metadata = metadata, - Tools = tools, - ToolChoice = toolChoice, - Thinking = thinking, - }; - - return await AnthropicMessagesAsync( - xApiKey: xApiKey, - anthropicVersion: anthropicVersion, - anthropicBeta: anthropicBeta, - xDeepinfraSource: xDeepinfraSource, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessagesCountTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessagesCountTokens.g.cs deleted file mode 100644 index af78604b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessagesCountTokens.g.cs +++ /dev/null @@ -1,266 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAnthropicMessagesCountTokensArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xApiKey, - global::DeepInfra.AnthropicTokenCountRequest request); - partial void PrepareAnthropicMessagesCountTokensRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xApiKey, - global::DeepInfra.AnthropicTokenCountRequest request); - partial void ProcessAnthropicMessagesCountTokensResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAnthropicMessagesCountTokensResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Anthropic Messages Count Tokens - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AnthropicMessagesCountTokensAsync( - - global::DeepInfra.AnthropicTokenCountRequest request, - string? xApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareAnthropicMessagesCountTokensArguments( - httpClient: HttpClient, - xApiKey: ref xApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/anthropic/v1/messages/count_tokens", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAnthropicMessagesCountTokensRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xApiKey: xApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAnthropicMessagesCountTokensResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAnthropicMessagesCountTokensResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Anthropic Messages Count Tokens - /// - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AnthropicMessagesCountTokensAsync( - string model, - global::System.Collections.Generic.IList messages, - string? xApiKey = default, - global::DeepInfra.AnyOf, object>? system = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnthropicThinkingConfig? thinking = default, - object? toolChoice = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.AnthropicTokenCountRequest - { - Model = model, - Messages = messages, - System = system, - Tools = tools, - Thinking = thinking, - ToolChoice = toolChoice, - }; - - return await AnthropicMessagesCountTokensAsync( - xApiKey: xApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Authorizations.Bearer.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Authorizations.Bearer.g.cs index 5bd69a32..a760d462 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Authorizations.Bearer.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Authorizations.Bearer.g.cs @@ -5,16 +5,27 @@ namespace DeepInfra { public sealed partial class DeepInfraClient { + /// public void AuthorizeUsingBearer( string apiKey) { apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - Authorizations.Clear(); + 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::DeepInfra.EndPointAuthorization { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", Value = apiKey, diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.BillingPortal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.BillingPortal.g.cs deleted file mode 100644 index dd970589..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.BillingPortal.g.cs +++ /dev/null @@ -1,221 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareBillingPortalArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? returnUrl, - object? session); - partial void PrepareBillingPortalRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? returnUrl, - object? session); - partial void ProcessBillingPortalResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessBillingPortalResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Billing Portal - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task BillingPortalAsync( - string? returnUrl = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareBillingPortalArguments( - httpClient: HttpClient, - returnUrl: ref returnUrl, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/billing-portal", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("return_url", returnUrl) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareBillingPortalRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - returnUrl: returnUrl, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessBillingPortalResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessBillingPortalResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.BillingPortalOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.BillingPortalOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CliVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CliVersion.g.cs deleted file mode 100644 index f14aae33..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CliVersion.g.cs +++ /dev/null @@ -1,211 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCliVersionArguments( - global::System.Net.Http.HttpClient httpClient, - ref string version); - partial void PrepareCliVersionRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string version); - partial void ProcessCliVersionResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCliVersionResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Cli Version - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CliVersionAsync( - string version, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareCliVersionArguments( - httpClient: HttpClient, - version: ref version); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/cli/version", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("version", version) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCliVersionRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - version: version); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCliVersionResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCliVersionResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Constructors.Bearer.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Constructors.Bearer.g.cs index bc94b239..a8454b5b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Constructors.Bearer.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Constructors.Bearer.g.cs @@ -6,6 +6,7 @@ namespace DeepInfra public sealed partial class DeepInfraClient { /// + public DeepInfraClient( string apiKey, global::System.Net.Http.HttpClient? httpClient = null, @@ -25,5 +26,6 @@ partial void Authorizing( ref string apiKey); partial void Authorized( global::System.Net.Http.HttpClient client); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsDelete.g.cs deleted file mode 100644 index caf72500..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsDelete.g.cs +++ /dev/null @@ -1,296 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsDeleteArguments( - global::System.Net.Http.HttpClient httpClient, - ref string containerId, - ref string? xiApiKey); - partial void PrepareContainerRentalsDeleteRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string containerId, - string? xiApiKey); - partial void ProcessContainerRentalsDeleteResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsDeleteResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals Delete - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsDeleteAsync( - string containerId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsDeleteArguments( - httpClient: HttpClient, - containerId: ref containerId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/containers/{containerId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - containerId: containerId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsDeleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGet.g.cs deleted file mode 100644 index c75b1752..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGet.g.cs +++ /dev/null @@ -1,300 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string containerId, - ref string? xiApiKey); - partial void PrepareContainerRentalsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string containerId, - string? xiApiKey); - partial void ProcessContainerRentalsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals Get - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsGetAsync( - string containerId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsGetArguments( - httpClient: HttpClient, - containerId: ref containerId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/containers/{containerId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - containerId: containerId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ContainerRentalOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ContainerRentalOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGetParams.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGetParams.g.cs deleted file mode 100644 index 27643614..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGetParams.g.cs +++ /dev/null @@ -1,252 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsGetParamsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareContainerRentalsGetParamsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessContainerRentalsGetParamsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsGetParamsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals Get Params - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsGetParamsAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsGetParamsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/containers/params", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsGetParamsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsGetParamsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsGetParamsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsList.g.cs deleted file mode 100644 index adab7199..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsList.g.cs +++ /dev/null @@ -1,306 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsListArguments( - global::System.Net.Http.HttpClient httpClient, - ref global::DeepInfra.ContainerRentalsListV1ContainersGetState? state, - ref string? xiApiKey); - partial void PrepareContainerRentalsListRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::DeepInfra.ContainerRentalsListV1ContainersGetState? state, - string? xiApiKey); - partial void ProcessContainerRentalsListResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsListResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals List - /// - /// - /// whether to return active or inactive containers
- /// Default Value: active - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ContainerRentalsListAsync( - global::DeepInfra.ContainerRentalsListV1ContainersGetState? state = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsListArguments( - httpClient: HttpClient, - state: ref state, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/containers", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("state", state?.ToValueString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsListRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - state: state, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsListResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unprocessable Entity - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.DeepError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsListResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsStart.g.cs deleted file mode 100644 index 9afcf147..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsStart.g.cs +++ /dev/null @@ -1,386 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsStartArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.ContainerRentalStartIn request); - partial void PrepareContainerRentalsStartRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.ContainerRentalStartIn request); - partial void ProcessContainerRentalsStartResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsStartResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals Start - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsStartAsync( - - global::DeepInfra.ContainerRentalStartIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsStartArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/containers", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsStartRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsStartResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unprocessable Entity - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.DeepError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Too Many Requests - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::DeepInfra.DeepError? __value_429 = null; - try - { - if (ReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_429 = global::DeepInfra.DeepError.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_429 = global::DeepInfra.DeepError.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsStartResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ContainerRentalStartOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ContainerRentalStartOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Container Rentals Start - /// - /// - /// - /// Container Name - /// - /// - /// GPU config - /// - /// - /// Container Image - /// - /// - /// Cloud Init User Data - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsStartAsync( - string name, - string gpuConfig, - string containerImage, - string cloudInitUserData, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ContainerRentalStartIn - { - Name = name, - GpuConfig = gpuConfig, - ContainerImage = containerImage, - CloudInitUserData = cloudInitUserData, - }; - - return await ContainerRentalsStartAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsUpdate.g.cs deleted file mode 100644 index e721f0d5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsUpdate.g.cs +++ /dev/null @@ -1,338 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsUpdateArguments( - global::System.Net.Http.HttpClient httpClient, - ref string containerId, - ref string? xiApiKey, - global::DeepInfra.ContainerRentalUpdateIn request); - partial void PrepareContainerRentalsUpdateRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string containerId, - string? xiApiKey, - global::DeepInfra.ContainerRentalUpdateIn request); - partial void ProcessContainerRentalsUpdateResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsUpdateResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsUpdateAsync( - string containerId, - - global::DeepInfra.ContainerRentalUpdateIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsUpdateArguments( - httpClient: HttpClient, - containerId: ref containerId, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/containers/{containerId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsUpdateRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - containerId: containerId, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsUpdateResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unprocessable Entity - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.DeepError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsUpdateResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Container Rentals Update - /// - /// - /// - /// - /// Container Name - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsUpdateAsync( - string containerId, - string name, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ContainerRentalUpdateIn - { - Name = name, - }; - - return await ContainerRentalsUpdateAsync( - containerId: containerId, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateApiToken.g.cs deleted file mode 100644 index a77b1a9e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateApiToken.g.cs +++ /dev/null @@ -1,293 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateApiTokenArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.ApiTokenIn request); - partial void PrepareCreateApiTokenRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.ApiTokenIn request); - partial void ProcessCreateApiTokenResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateApiTokenResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateApiTokenAsync( - - global::DeepInfra.ApiTokenIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateApiTokenArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/api-tokens", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateApiTokenRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateApiTokenResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateApiTokenResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ApiToken.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ApiToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateApiTokenAsync( - string name, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ApiTokenIn - { - Name = name, - }; - - return await CreateApiTokenAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateLora.g.cs deleted file mode 100644 index 02e26c76..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateLora.g.cs +++ /dev/null @@ -1,267 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateLoraArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.CreateLoraApiRequest request); - partial void PrepareCreateLoraRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.CreateLoraApiRequest request); - partial void ProcessCreateLoraResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateLoraResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Lora - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateLoraAsync( - - global::DeepInfra.CreateLoraApiRequest request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateLoraArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/lora/create", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateLoraRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateLoraResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateLoraResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Lora - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateLoraAsync( - string baseModel, - string loraName, - global::DeepInfra.SourceModel source, - bool @private, - string? xiApiKey = default, - string? description = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.CreateLoraApiRequest - { - BaseModel = baseModel, - LoraName = loraName, - Source = source, - Private = @private, - Description = description, - }; - - return await CreateLoraAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch.g.cs deleted file mode 100644 index 9c58b961..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch.g.cs +++ /dev/null @@ -1,272 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateOpenaiBatchArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.OpenAIBatchesIn request); - partial void PrepareCreateOpenaiBatchRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.OpenAIBatchesIn request); - partial void ProcessCreateOpenaiBatchResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateOpenaiBatchResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateOpenaiBatchAsync( - - global::DeepInfra.OpenAIBatchesIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateOpenaiBatchArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/batches", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateOpenaiBatchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateOpenaiBatchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateOpenaiBatchResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIBatch.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Openai Batch - /// - /// - /// - /// The ID of an uploaded file that contains requests for the new batch. - /// - /// - /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. - /// - /// - /// The time frame within which the batch should be processed. Currently only 24h is supported. - /// - /// - /// Optional metadata to be stored with the batch. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateOpenaiBatchAsync( - string inputFileId, - global::DeepInfra.OpenAIBatchesInEndpoint endpoint, - string? xiApiKey = default, - string completionWindow = "24h", - object? metadata = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIBatchesIn - { - InputFileId = inputFileId, - Endpoint = endpoint, - CompletionWindow = completionWindow, - Metadata = metadata, - }; - - return await CreateOpenaiBatchAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch2.g.cs deleted file mode 100644 index d401d0e0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch2.g.cs +++ /dev/null @@ -1,272 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateOpenaiBatch2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.OpenAIBatchesIn request); - partial void PrepareCreateOpenaiBatch2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.OpenAIBatchesIn request); - partial void ProcessCreateOpenaiBatch2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateOpenaiBatch2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateOpenaiBatch2Async( - - global::DeepInfra.OpenAIBatchesIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateOpenaiBatch2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/batches", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateOpenaiBatch2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateOpenaiBatch2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateOpenaiBatch2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIBatch.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Openai Batch - /// - /// - /// - /// The ID of an uploaded file that contains requests for the new batch. - /// - /// - /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. - /// - /// - /// The time frame within which the batch should be processed. Currently only 24h is supported. - /// - /// - /// Optional metadata to be stored with the batch. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateOpenaiBatch2Async( - string inputFileId, - global::DeepInfra.OpenAIBatchesInEndpoint endpoint, - string? xiApiKey = default, - string completionWindow = "24h", - object? metadata = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIBatchesIn - { - InputFileId = inputFileId, - Endpoint = endpoint, - CompletionWindow = completionWindow, - Metadata = metadata, - }; - - return await CreateOpenaiBatch2Async( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateScopedJwt.g.cs deleted file mode 100644 index e3e72643..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateScopedJwt.g.cs +++ /dev/null @@ -1,275 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateScopedJwtArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.ScopedJWTIn request); - partial void PrepareCreateScopedJwtRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.ScopedJWTIn request); - partial void ProcessCreateScopedJwtResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateScopedJwtResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Scoped Jwt - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateScopedJwtAsync( - - global::DeepInfra.ScopedJWTIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateScopedJwtArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/scoped-jwt", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateScopedJwtRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateScopedJwtResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateScopedJwtResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ScopedJWTOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ScopedJWTOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Scoped Jwt - /// - /// - /// - /// - /// allow inference only to the specified model names - /// - /// - /// how many seconds in the future should the token be valid for - /// - /// - /// unix timestamp when the token should expire - /// - /// - /// only allow spending that much USD until the token becomes invalid - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateScopedJwtAsync( - string apiKeyName, - string? xiApiKey = default, - global::System.Collections.Generic.IList? models = default, - int? expiresDelta = default, - int? expiresAt = default, - double? spendingLimit = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ScopedJWTIn - { - ApiKeyName = apiKeyName, - Models = models, - ExpiresDelta = expiresDelta, - ExpiresAt = expiresAt, - SpendingLimit = spendingLimit, - }; - - return await CreateScopedJwtAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateSshKey.g.cs deleted file mode 100644 index 50c324ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateSshKey.g.cs +++ /dev/null @@ -1,300 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateSshKeyArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.SshKeyIn request); - partial void PrepareCreateSshKeyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.SshKeyIn request); - partial void ProcessCreateSshKeyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateSshKeyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Ssh Key - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateSshKeyAsync( - - global::DeepInfra.SshKeyIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateSshKeyArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/ssh_keys", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateSshKeyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateSshKeyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateSshKeyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.SshKeyOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.SshKeyOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Ssh Key - /// - /// - /// - /// SSH Key name - /// - /// - /// SSH Key content - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateSshKeyAsync( - string name, - string key, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.SshKeyIn - { - Name = name, - Key = key, - }; - - return await CreateSshKeyAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateVoice.g.cs deleted file mode 100644 index f5edf120..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateVoice.g.cs +++ /dev/null @@ -1,322 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateVoiceArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request); - partial void PrepareCreateVoiceRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request); - partial void ProcessCreateVoiceResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateVoiceResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Voice
- /// Create a new voice - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateVoiceAsync( - - global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateVoiceArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/voices/add", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Name}"), - name: "\"name\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Description}"), - name: "\"description\""); - for (var __iFiles = 0; __iFiles < request.Files.Count; __iFiles++) - { - var __contentFiles = new global::System.Net.Http.ByteArrayContent(request.Files[__iFiles]); - __httpRequestContent.Add( - content: __contentFiles, - name: "\"files\"", - fileName: $"\"file{__iFiles}.bin\""); - if (__contentFiles.Headers.ContentDisposition != null) - { - __contentFiles.Headers.ContentDisposition.FileNameStar = null; - } - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateVoiceRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateVoiceResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateVoiceResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Voice
- /// Create a new voice - ///
- /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateVoiceAsync( - string name, - string description, - global::System.Collections.Generic.IList files, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyCreateVoiceV1VoicesAddPost - { - Name = name, - Description = description, - Files = files, - }; - - return await CreateVoiceAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeepstartApply.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeepstartApply.g.cs deleted file mode 100644 index 4534e9bd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeepstartApply.g.cs +++ /dev/null @@ -1,278 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeepstartApplyArguments( - global::System.Net.Http.HttpClient httpClient, - object? session, - global::DeepInfra.DeepStartApplicationIn request); - partial void PrepareDeepstartApplyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - object? session, - global::DeepInfra.DeepStartApplicationIn request); - partial void ProcessDeepstartApplyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeepstartApplyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deepstart Apply - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeepstartApplyAsync( - - global::DeepInfra.DeepStartApplicationIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDeepstartApplyArguments( - httpClient: HttpClient, - session: session, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/deepstart/application", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeepstartApplyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - session: session, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeepstartApplyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeepstartApplyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeepStartApplicationOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeepStartApplicationOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Deepstart Apply - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: pending - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeepstartApplyAsync( - string company, - string ceo, - string funding, - string foundedOn, - string website, - object? session = default, - string? id = default, - string? uid = default, - int? createdAt = default, - string? status = default, - string? deal = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.DeepStartApplicationIn - { - Id = id, - Uid = uid, - Company = company, - Ceo = ceo, - Funding = funding, - FoundedOn = foundedOn, - Website = website, - CreatedAt = createdAt, - Status = status, - Deal = deal, - }; - - return await DeepstartApplyAsync( - session: session, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteAccount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteAccount.g.cs deleted file mode 100644 index 2bb57d09..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteAccount.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteAccountArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareDeleteAccountRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessDeleteAccountResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteAccountResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Account - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteAccountAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteAccountArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteAccountRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteAccountResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteAccountResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Me.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Me.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteApiToken.g.cs deleted file mode 100644 index 63f40260..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteApiToken.g.cs +++ /dev/null @@ -1,258 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteApiTokenArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiToken, - ref string? xiApiKey); - partial void PrepareDeleteApiTokenRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiToken, - string? xiApiKey); - partial void ProcessDeleteApiTokenResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteApiTokenResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteApiTokenAsync( - string apiToken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteApiTokenArguments( - httpClient: HttpClient, - apiToken: ref apiToken, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/api-tokens/{apiToken}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteApiTokenRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiToken: apiToken, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteApiTokenResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteApiTokenResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLora.g.cs deleted file mode 100644 index d0d11268..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLora.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteLoraArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loraName, - ref string? xiApiKey); - partial void PrepareDeleteLoraRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loraName, - string? xiApiKey); - partial void ProcessDeleteLoraResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteLoraResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Lora - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteLoraAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteLoraArguments( - httpClient: HttpClient, - loraName: ref loraName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/lora/{loraName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteLoraRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loraName: loraName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteLoraResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteLoraResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLoraModel.g.cs deleted file mode 100644 index 4b745619..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLoraModel.g.cs +++ /dev/null @@ -1,258 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteLoraModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loraModelName, - ref string? xiApiKey); - partial void PrepareDeleteLoraModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loraModelName, - string? xiApiKey); - partial void ProcessDeleteLoraModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteLoraModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Lora Model - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteLoraModelAsync( - string loraModelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteLoraModelArguments( - httpClient: HttpClient, - loraModelName: ref loraModelName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/lora-model/{loraModelName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteLoraModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loraModelName: loraModelName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteLoraModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteLoraModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteSshKey.g.cs deleted file mode 100644 index 36dad29c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteSshKey.g.cs +++ /dev/null @@ -1,258 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteSshKeyArguments( - global::System.Net.Http.HttpClient httpClient, - ref string sshKeyId, - ref string? xiApiKey); - partial void PrepareDeleteSshKeyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string sshKeyId, - string? xiApiKey); - partial void ProcessDeleteSshKeyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteSshKeyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Ssh Key - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteSshKeyAsync( - string sshKeyId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteSshKeyArguments( - httpClient: HttpClient, - sshKeyId: ref sshKeyId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/ssh_keys/{sshKeyId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteSshKeyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - sshKeyId: sshKeyId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteSshKeyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteSshKeyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteVoice.g.cs deleted file mode 100644 index 193a105f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteVoice.g.cs +++ /dev/null @@ -1,296 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteVoiceArguments( - global::System.Net.Http.HttpClient httpClient, - ref string voiceId, - ref string? xiApiKey); - partial void PrepareDeleteVoiceRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string voiceId, - string? xiApiKey); - partial void ProcessDeleteVoiceResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteVoiceResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Voice - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteVoiceAsync( - string voiceId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteVoiceArguments( - httpClient: HttpClient, - voiceId: ref voiceId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/voices/{voiceId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteVoiceRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - voiceId: voiceId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteVoiceResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteVoiceResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreate.g.cs deleted file mode 100644 index b15df214..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreate.g.cs +++ /dev/null @@ -1,382 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployCreateArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.DeployModelIn request); - partial void PrepareDeployCreateRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.DeployModelIn request); - partial void ProcessDeployCreateResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployCreateResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Create - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateAsync( - - global::DeepInfra.DeployModelIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDeployCreateArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/deploy", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployCreateRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployCreateResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Locked - if ((int)__response.StatusCode == 423) - { - string? __content_423 = null; - global::System.Exception? __exception_423 = null; - global::DeepInfra.DeepError? __value_423 = null; - try - { - if (ReadResponseAsString) - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - else - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_423 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_423, - statusCode: __response.StatusCode) - { - ResponseBody = __content_423, - ResponseObject = __value_423, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployCreateResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Deploy Create - /// - /// - /// - /// namespace for the model name
- /// Default Value: cnt - /// - /// - /// model name in specified provider - /// - /// - /// A specific revision, if left empty uses the last one - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateAsync( - string modelName, - string? xiApiKey = default, - global::DeepInfra.ModelProvider? provider = default, - string? version = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.DeployModelIn - { - Provider = provider, - ModelName = modelName, - Version = version, - }; - - return await DeployCreateAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateHf.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateHf.g.cs deleted file mode 100644 index f475b467..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateHf.g.cs +++ /dev/null @@ -1,376 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployCreateHfArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.HFModel request); - partial void PrepareDeployCreateHfRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.HFModel request); - partial void ProcessDeployCreateHfResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployCreateHfResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Create Hf - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateHfAsync( - - global::DeepInfra.HFModel request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDeployCreateHfArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/deploy/hf/", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployCreateHfRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployCreateHfResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Locked - if ((int)__response.StatusCode == 423) - { - string? __content_423 = null; - global::System.Exception? __exception_423 = null; - global::DeepInfra.DeepError? __value_423 = null; - try - { - if (ReadResponseAsString) - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - else - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_423 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_423, - statusCode: __response.StatusCode) - { - ResponseBody = __content_423, - ResponseObject = __value_423, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployCreateHfResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Deploy Create Hf - /// - /// - /// - /// Model Id from huggingface - /// - /// - /// Task - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateHfAsync( - string modelName, - string? xiApiKey = default, - string? task = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.HFModel - { - ModelName = modelName, - Task = task, - }; - - return await DeployCreateHfAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateLlm.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateLlm.g.cs deleted file mode 100644 index 57b1f547..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateLlm.g.cs +++ /dev/null @@ -1,371 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployCreateLlmArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.DeployLLMIn request); - partial void PrepareDeployCreateLlmRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.DeployLLMIn request); - partial void ProcessDeployCreateLlmResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployCreateLlmResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Create Llm - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateLlmAsync( - - global::DeepInfra.DeployLLMIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDeployCreateLlmArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/deploy/llm", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployCreateLlmRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployCreateLlmResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Payment Required - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::DeepInfra.DeepError? __value_402 = null; - try - { - if (ReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_402 = global::DeepInfra.DeepError.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_402 = global::DeepInfra.DeepError.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unprocessable Entity - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.DeepError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployCreateLlmResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Deploy Create Llm - /// - /// - /// - /// model name for deepinfra (username/mode-name format) - /// - /// - /// The type of GPU the deployment is running on - /// - /// - /// Number of GPUs used by one instance
- /// Default Value: 1 - /// - /// - /// Maximum number of concurrent requests
- /// Default Value: 96 - /// - /// - /// - /// Base public model - /// - /// - /// Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4) - /// - /// - /// - /// Extra command line arguments for custom deployments - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateLlmAsync( - string modelName, - global::DeepInfra.DeployGPUs gpu, - string? xiApiKey = default, - int? numGpus = default, - int? maxBatchSize = default, - global::DeepInfra.HFWeights? hf = default, - string? baseModel = default, - string? containerImage = default, - global::DeepInfra.ScaleSettings? settings = default, - global::System.Collections.Generic.IList? extraArgs = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.DeployLLMIn - { - ModelName = modelName, - Gpu = gpu, - NumGpus = numGpus, - MaxBatchSize = maxBatchSize, - Hf = hf, - BaseModel = baseModel, - ContainerImage = containerImage, - Settings = settings, - ExtraArgs = extraArgs, - }; - - return await DeployCreateLlmAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDelete.g.cs deleted file mode 100644 index 1a779acf..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDelete.g.cs +++ /dev/null @@ -1,262 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployDeleteArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey); - partial void PrepareDeployDeleteRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey); - partial void ProcessDeployDeleteResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployDeleteResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Delete - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployDeleteAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployDeleteArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployDeleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployDelete.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployDelete.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDetailedStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDetailedStats.g.cs deleted file mode 100644 index a6700064..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDetailedStats.g.cs +++ /dev/null @@ -1,321 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployDetailedStatsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string from, - ref string? to, - ref string? xiApiKey); - partial void PrepareDeployDetailedStatsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string from, - string? to, - string? xiApiKey); - partial void ProcessDeployDetailedStatsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployDetailedStatsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Detailed Stats - /// - /// - /// - /// start of period, unix ts or 'now-5h', supported units s, m, h, d, w - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployDetailedStatsAsync( - string deployId, - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployDetailedStatsArguments( - httpClient: HttpClient, - deployId: ref deployId, - from: ref from, - to: ref to, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}/stats2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployDetailedStatsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - from: from, - to: to, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployDetailedStatsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Gone - if ((int)__response.StatusCode == 410) - { - string? __content_410 = null; - global::System.Exception? __exception_410 = null; - global::DeepInfra.DeepError? __value_410 = null; - try - { - if (ReadResponseAsString) - { - __content_410 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); - } - else - { - __content_410 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_410 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_410 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_410, - statusCode: __response.StatusCode) - { - ResponseBody = __content_410, - ResponseObject = __value_410, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployDetailedStatsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DetailedDeploymentStatsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DetailedDeploymentStatsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployGpuAvailability.g.cs deleted file mode 100644 index 5dbadbd6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployGpuAvailability.g.cs +++ /dev/null @@ -1,234 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployGpuAvailabilityArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? source, - ref string? baseModel, - ref string? xiApiKey); - partial void PrepareDeployGpuAvailabilityRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? source, - string? baseModel, - string? xiApiKey); - partial void ProcessDeployGpuAvailabilityResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployGpuAvailabilityResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Gpu Availability - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployGpuAvailabilityAsync( - string? source = default, - string? baseModel = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployGpuAvailabilityArguments( - httpClient: HttpClient, - source: ref source, - baseModel: ref baseModel, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/deploy/llm/gpu_availability", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("source", source) - .AddOptionalParameter("base_model", baseModel) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployGpuAvailabilityRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - source: source, - baseModel: baseModel, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployGpuAvailabilityResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployGpuAvailabilityResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployGPUAvailability.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployGPUAvailability.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployList2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployList2.g.cs deleted file mode 100644 index eeec4628..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployList2.g.cs +++ /dev/null @@ -1,267 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployList2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? status, - ref string? xiApiKey); - partial void PrepareDeployList2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? status, - string? xiApiKey); - partial void ProcessDeployList2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployList2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy List - /// - /// - /// A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> DeployList2Async( - string? status = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployList2Arguments( - httpClient: HttpClient, - status: ref status, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/deploy/list", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("status", status) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployList2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - status: status, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployList2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployList2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStart.g.cs deleted file mode 100644 index e31ae6d4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStart.g.cs +++ /dev/null @@ -1,301 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployStartArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey); - partial void PrepareDeployStartRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey); - partial void ProcessDeployStartResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployStartResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Start
- /// Start a stopped deployment. Re-creates pods via auto-scaling. - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployStartAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployStartArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}/start", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployStartRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployStartResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployStartResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployStatusOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStats.g.cs deleted file mode 100644 index 54e552ec..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStats.g.cs +++ /dev/null @@ -1,321 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployStatsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string from, - ref string? to, - ref string? xiApiKey); - partial void PrepareDeployStatsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string from, - string? to, - string? xiApiKey); - partial void ProcessDeployStatsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployStatsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Stats - /// - /// - /// - /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployStatsAsync( - string deployId, - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployStatsArguments( - httpClient: HttpClient, - deployId: ref deployId, - from: ref from, - to: ref to, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}/stats", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployStatsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - from: from, - to: to, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployStatsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Gone - if ((int)__response.StatusCode == 410) - { - string? __content_410 = null; - global::System.Exception? __exception_410 = null; - global::DeepInfra.DeepError? __value_410 = null; - try - { - if (ReadResponseAsString) - { - __content_410 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); - } - else - { - __content_410 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_410 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_410 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_410, - statusCode: __response.StatusCode) - { - ResponseBody = __content_410, - ResponseObject = __value_410, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployStatsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentStatsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentStatsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStatus.g.cs deleted file mode 100644 index dd51fd53..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStatus.g.cs +++ /dev/null @@ -1,262 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployStatusArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey); - partial void PrepareDeployStatusRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey); - partial void ProcessDeployStatusResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployStatusResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Status - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployStatusAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployStatusArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployStatusRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployStatusResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployStatusResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStop.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStop.g.cs deleted file mode 100644 index 1c0008b8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStop.g.cs +++ /dev/null @@ -1,301 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployStopArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey); - partial void PrepareDeployStopRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey); - partial void ProcessDeployStopResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployStopResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Stop
- /// Stop a running deployment. Terminates pods. Can be restarted later. - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployStopAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployStopArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}/stop", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployStopRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployStopResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployStopResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployStatusOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployUpdate.g.cs deleted file mode 100644 index 1175d1ce..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployUpdate.g.cs +++ /dev/null @@ -1,378 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployUpdateArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey, - global::DeepInfra.DeployLLMUpdateIn request); - partial void PrepareDeployUpdateRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey, - global::DeepInfra.DeployLLMUpdateIn request); - partial void ProcessDeployUpdateResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployUpdateResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployUpdateAsync( - string deployId, - - global::DeepInfra.DeployLLMUpdateIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDeployUpdateArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Put, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployUpdateRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployUpdateResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployUpdateResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployStatusOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Deploy Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployUpdateAsync( - string deployId, - global::DeepInfra.ScaleSettings settings, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.DeployLLMUpdateIn - { - Settings = settings, - }; - - return await DeployUpdateAsync( - deployId: deployId, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentLogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentLogsQuery.g.cs deleted file mode 100644 index 31a2ae16..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentLogsQuery.g.cs +++ /dev/null @@ -1,348 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeploymentLogsQueryArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? podName, - ref string? from, - ref string? to, - ref int? limit, - ref string? xiApiKey); - partial void PrepareDeploymentLogsQueryRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? podName, - string? from, - string? to, - int? limit, - string? xiApiKey); - partial void ProcessDeploymentLogsQueryResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeploymentLogsQueryResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deployment Logs Query
- /// Query deployment logs.
- /// * Without timestamps (from/to) returns last `limit` messages (in last month).
- /// * With `from` only, returns first `limit` messages after `from` (inclusive).
- /// * With `to` only, returns last `limit` messages before `to` (inclusive).
- /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
- /// * `from` and `to` should be no more than a month apart. - ///
- /// - /// the deploy id to get the logs from - /// - /// - /// the pod name to get the logs from - /// - /// - /// start of period, in fractional seconds since unix epoch (inclusive) - /// - /// - /// end of period, in fractional seconds since unix epoch (exclusive) - /// - /// - /// how many items to return at most (default 100, in [1, 1000])
- /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeploymentLogsQueryAsync( - string deployId, - string? podName = default, - string? from = default, - string? to = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeploymentLogsQueryArguments( - httpClient: HttpClient, - deployId: ref deployId, - podName: ref podName, - from: ref from, - to: ref to, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/deployment_logs/query", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("deploy_id", deployId) - .AddOptionalParameter("pod_name", podName) - .AddOptionalParameter("from", from) - .AddOptionalParameter("to", to) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeploymentLogsQueryRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - podName: podName, - from: from, - to: to, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeploymentLogsQueryResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeploymentLogsQueryResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentLogQueryOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentLogQueryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentStats.g.cs deleted file mode 100644 index 7aa5dfae..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentStats.g.cs +++ /dev/null @@ -1,239 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeploymentStatsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string from, - ref string? to, - ref string? xiApiKey); - partial void PrepareDeploymentStatsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string from, - string? to, - string? xiApiKey); - partial void ProcessDeploymentStatsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeploymentStatsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deployment Stats - /// - /// - /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> DeploymentStatsAsync( - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeploymentStatsArguments( - httpClient: HttpClient, - from: ref from, - to: ref to, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/deploy/stats", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeploymentStatsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - from: from, - to: to, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeploymentStatsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeploymentStatsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ExportApiTokenToVercel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ExportApiTokenToVercel.g.cs deleted file mode 100644 index 3bb45a0f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ExportApiTokenToVercel.g.cs +++ /dev/null @@ -1,310 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareExportApiTokenToVercelArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiToken, - ref string? xiApiKey, - global::DeepInfra.ApiTokenVercelExportIn request); - partial void PrepareExportApiTokenToVercelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiToken, - string? xiApiKey, - global::DeepInfra.ApiTokenVercelExportIn request); - partial void ProcessExportApiTokenToVercelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessExportApiTokenToVercelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Export Api Token To Vercel - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ExportApiTokenToVercelAsync( - string apiToken, - - global::DeepInfra.ApiTokenVercelExportIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareExportApiTokenToVercelArguments( - httpClient: HttpClient, - apiToken: ref apiToken, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/api-tokens/{apiToken}/vercel_export", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareExportApiTokenToVercelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiToken: apiToken, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessExportApiTokenToVercelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessExportApiTokenToVercelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Export Api Token To Vercel - /// - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ExportApiTokenToVercelAsync( - string apiToken, - string projectIdOrName, - bool isSensitive, - bool envDevelopment, - bool envPreview, - bool envProduction, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ApiTokenVercelExportIn - { - ProjectIdOrName = projectIdOrName, - IsSensitive = isSensitive, - EnvDevelopment = envDevelopment, - EnvPreview = envPreview, - EnvProduction = envProduction, - }; - - return await ExportApiTokenToVercelAsync( - apiToken: apiToken, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiToken.g.cs deleted file mode 100644 index cd218c98..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiToken.g.cs +++ /dev/null @@ -1,262 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetApiTokenArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiToken, - ref string? xiApiKey); - partial void PrepareGetApiTokenRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiToken, - string? xiApiKey); - partial void ProcessGetApiTokenResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiTokenResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetApiTokenAsync( - string apiToken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiTokenArguments( - httpClient: HttpClient, - apiToken: ref apiToken, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/api-tokens/{apiToken}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiTokenRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiToken: apiToken, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiTokenResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiTokenResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ApiToken.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ApiToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiTokens.g.cs deleted file mode 100644 index 172a5634..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiTokens.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetApiTokensArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareGetApiTokensRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessGetApiTokensResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiTokensResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Api Tokens - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetApiTokensAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiTokensArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/api-tokens", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiTokensRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiTokensResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiTokensResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetChecklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetChecklist.g.cs deleted file mode 100644 index 5f3cb3d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetChecklist.g.cs +++ /dev/null @@ -1,223 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetChecklistArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? computeOwed, - object? session); - partial void PrepareGetChecklistRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? computeOwed, - object? session); - partial void ProcessGetChecklistResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetChecklistResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Checklist - /// - /// - /// Default Value: false - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetChecklistAsync( - bool? computeOwed = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetChecklistArguments( - httpClient: HttpClient, - computeOwed: ref computeOwed, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/checklist", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("compute_owed", computeOwed?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetChecklistRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - computeOwed: computeOwed, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetChecklistResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetChecklistResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Checklist.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Checklist.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetConfig.g.cs deleted file mode 100644 index 32c8afa5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetConfig.g.cs +++ /dev/null @@ -1,212 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetConfigArguments( - global::System.Net.Http.HttpClient httpClient, - object? session); - partial void PrepareGetConfigRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - object? session); - partial void ProcessGetConfigResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetConfigResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Config - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetConfigAsync( - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetConfigArguments( - httpClient: HttpClient, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/config", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetConfigRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetConfigResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetConfigResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ConfigOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ConfigOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetHardware.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetHardware.g.cs deleted file mode 100644 index 50cf701e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetHardware.g.cs +++ /dev/null @@ -1,229 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetHardwareArguments( - global::System.Net.Http.HttpClient httpClient, - ref string model, - ref string? xiApiKey); - partial void PrepareGetHardwareRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string model, - string? xiApiKey); - partial void ProcessGetHardwareResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetHardwareResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Hardware - /// - /// - /// Model name (NVIDIA NemoClaw format) - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetHardwareAsync( - string model, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetHardwareArguments( - httpClient: HttpClient, - model: ref model, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v2/hardware", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("model", model) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetHardwareRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - model: model, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetHardwareResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetHardwareResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.HardwareResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.HardwareResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLiveMetrics.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLiveMetrics.g.cs deleted file mode 100644 index bfe8db6e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLiveMetrics.g.cs +++ /dev/null @@ -1,169 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetLiveMetricsArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetLiveMetricsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetLiveMetricsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetLiveMetricsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Live Metrics
- /// Get the latest values for the Live metrics section on the web front page. - ///
- /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetLiveMetricsAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetLiveMetricsArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/metrics/live", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetLiveMetricsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetLiveMetricsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetLiveMetricsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.WebLiveMetricsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.WebLiveMetricsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLora.g.cs deleted file mode 100644 index 2281990d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLora.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetLoraArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loraName, - ref string? xiApiKey); - partial void PrepareGetLoraRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loraName, - string? xiApiKey); - partial void ProcessGetLoraResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetLoraResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Lora - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetLoraAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetLoraArguments( - httpClient: HttpClient, - loraName: ref loraName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/lora/{loraName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetLoraRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loraName: loraName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetLoraResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetLoraResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLoraStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLoraStatus.g.cs deleted file mode 100644 index a633d02b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLoraStatus.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetLoraStatusArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loraName, - ref string? xiApiKey); - partial void PrepareGetLoraStatusRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loraName, - string? xiApiKey); - partial void ProcessGetLoraStatusResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetLoraStatusResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Lora Status - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetLoraStatusAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetLoraStatusArguments( - httpClient: HttpClient, - loraName: ref loraName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/lora/{loraName}/status", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetLoraStatusRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loraName: loraName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetLoraStatusResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetLoraStatusResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetModelLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetModelLoras.g.cs deleted file mode 100644 index 11e781e4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetModelLoras.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetModelLorasArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? xiApiKey); - partial void PrepareGetModelLorasRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? xiApiKey); - partial void ProcessGetModelLorasResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetModelLorasResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Model Loras - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetModelLorasAsync( - string modelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetModelLorasArguments( - httpClient: HttpClient, - modelName: ref modelName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/model/{modelName}/loras", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetModelLorasRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetModelLorasResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetModelLorasResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetRequestCosts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetRequestCosts.g.cs deleted file mode 100644 index ae9198c2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetRequestCosts.g.cs +++ /dev/null @@ -1,255 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetRequestCostsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.RequestCostQuery request); - partial void PrepareGetRequestCostsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.RequestCostQuery request); - partial void ProcessGetRequestCostsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetRequestCostsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Request Costs - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetRequestCostsAsync( - - global::DeepInfra.RequestCostQuery request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareGetRequestCostsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/request-costs", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetRequestCostsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetRequestCostsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetRequestCostsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.RequestCostResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.RequestCostResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Get Request Costs - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetRequestCostsAsync( - global::System.Collections.Generic.IList requestIds, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.RequestCostQuery - { - RequestIds = requestIds, - }; - - return await GetRequestCostsAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetSshKeys.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetSshKeys.g.cs deleted file mode 100644 index 6753f222..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetSshKeys.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetSshKeysArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareGetSshKeysRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessGetSshKeysResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetSshKeysResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Ssh Keys - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetSshKeysAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetSshKeysArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/ssh_keys", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetSshKeysRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetSshKeysResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetSshKeysResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetUserLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetUserLoras.g.cs deleted file mode 100644 index 6cefcd70..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetUserLoras.g.cs +++ /dev/null @@ -1,214 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetUserLorasArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareGetUserLorasRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessGetUserLorasResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetUserLorasResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get User Loras - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetUserLorasAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetUserLorasArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/user/loras", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetUserLorasRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetUserLorasResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetUserLorasResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoice.g.cs deleted file mode 100644 index 275e7359..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoice.g.cs +++ /dev/null @@ -1,263 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetVoiceArguments( - global::System.Net.Http.HttpClient httpClient, - ref string voiceId, - ref string? xiApiKey); - partial void PrepareGetVoiceRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string voiceId, - string? xiApiKey); - partial void ProcessGetVoiceResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetVoiceResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Voice
- /// Get a voice by its id - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetVoiceAsync( - string voiceId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetVoiceArguments( - httpClient: HttpClient, - voiceId: ref voiceId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/voices/{voiceId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetVoiceRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - voiceId: voiceId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetVoiceResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetVoiceResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoices.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoices.g.cs deleted file mode 100644 index 9b1d70fc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoices.g.cs +++ /dev/null @@ -1,257 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetVoicesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareGetVoicesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessGetVoicesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetVoicesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Voices
- /// Get available voices for a given user - ///
- /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetVoicesAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetVoicesArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/voices", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetVoicesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetVoicesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetVoicesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.GetVoicesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.GetVoicesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubCliLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubCliLogin.g.cs deleted file mode 100644 index dec10d67..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubCliLogin.g.cs +++ /dev/null @@ -1,213 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGithubCliLoginArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loginId); - partial void PrepareGithubCliLoginRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loginId); - partial void ProcessGithubCliLoginResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGithubCliLoginResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Github Cli Login
- /// deepctl is calling this request waiting for auth token during login.
- /// The token is stored in /github/callback - ///
- /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GithubCliLoginAsync( - string loginId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGithubCliLoginArguments( - httpClient: HttpClient, - loginId: ref loginId); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/github/cli/login", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("login_id", loginId) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGithubCliLoginRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loginId: loginId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGithubCliLoginResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGithubCliLoginResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubLogin.g.cs deleted file mode 100644 index aac25bed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubLogin.g.cs +++ /dev/null @@ -1,233 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGithubLoginArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? loginId, - ref string? origin, - ref string? deal, - ref string? tiToken); - partial void PrepareGithubLoginRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? loginId, - string? origin, - string? deal, - string? tiToken); - partial void ProcessGithubLoginResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGithubLoginResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Github Login
- /// Initiate github SSO login flow. Callback is /github/callback - ///
- /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GithubLoginAsync( - string? loginId = default, - string? origin = default, - string? deal = default, - string? tiToken = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGithubLoginArguments( - httpClient: HttpClient, - loginId: ref loginId, - origin: ref origin, - deal: ref deal, - tiToken: ref tiToken); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/github/login", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("login_id", loginId) - .AddOptionalParameter("origin", origin) - .AddOptionalParameter("deal", deal) - .AddOptionalParameter("ti_token", tiToken) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGithubLoginRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loginId: loginId, - origin: origin, - deal: deal, - tiToken: tiToken); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGithubLoginResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGithubLoginResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceDeploy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceDeploy.g.cs deleted file mode 100644 index 14e8fb8b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceDeploy.g.cs +++ /dev/null @@ -1,296 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareInferenceDeployArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey); - partial void PrepareInferenceDeployRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey); - partial void ProcessInferenceDeployResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessInferenceDeployResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Inference Deploy - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task InferenceDeployAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareInferenceDeployArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/inference/deploy/{deployId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareInferenceDeployRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessInferenceDeployResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessInferenceDeployResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceModel.g.cs deleted file mode 100644 index 38cb5b72..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceModel.g.cs +++ /dev/null @@ -1,345 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareInferenceModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? version, - ref string? xiApiKey); - partial void PrepareInferenceModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? version, - string? xiApiKey); - partial void ProcessInferenceModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessInferenceModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Inference Model - /// - /// - /// - /// model version to run inference against - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task InferenceModelAsync( - string modelName, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareInferenceModelArguments( - httpClient: HttpClient, - modelName: ref modelName, - version: ref version, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/inference/{modelName}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("version", version) - ; - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareInferenceModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - version: version, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessInferenceModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Locked - if ((int)__response.StatusCode == 423) - { - string? __content_423 = null; - global::System.Exception? __exception_423 = null; - global::DeepInfra.DeepError? __value_423 = null; - try - { - if (ReadResponseAsString) - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - else - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_423 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_423, - statusCode: __response.StatusCode) - { - ResponseBody = __content_423, - ResponseObject = __value_423, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessInferenceModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InspectScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InspectScopedJwt.g.cs deleted file mode 100644 index 0d79c3e7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InspectScopedJwt.g.cs +++ /dev/null @@ -1,227 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareInspectScopedJwtArguments( - global::System.Net.Http.HttpClient httpClient, - ref string jwtoken, - ref string? xiApiKey); - partial void PrepareInspectScopedJwtRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string jwtoken, - string? xiApiKey); - partial void ProcessInspectScopedJwtResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessInspectScopedJwtResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Inspect Scoped Jwt - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task InspectScopedJwtAsync( - string jwtoken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareInspectScopedJwtArguments( - httpClient: HttpClient, - jwtoken: ref jwtoken, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/scoped-jwt", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("jwtoken", jwtoken) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareInspectScopedJwtRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - jwtoken: jwtoken, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessInspectScopedJwtResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessInspectScopedJwtResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.InspectScopedJWTOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.InspectScopedJWTOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles.g.cs deleted file mode 100644 index c02312f9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles.g.cs +++ /dev/null @@ -1,246 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareListFilesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? after, - ref string? purpose, - ref string? order, - ref int? limit, - ref string? xiApiKey); - partial void PrepareListFilesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? after, - string? purpose, - string? order, - int? limit, - string? xiApiKey); - partial void ProcessListFilesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessListFilesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// List Files - /// - /// - /// - /// - /// - /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ListFilesAsync( - string? after = default, - string? purpose = default, - string? order = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareListFilesArguments( - httpClient: HttpClient, - after: ref after, - purpose: ref purpose, - order: ref order, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/files", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("after", after) - .AddOptionalParameter("purpose", purpose) - .AddOptionalParameter("order", order) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListFilesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - after: after, - purpose: purpose, - order: order, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListFilesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessListFilesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles2.g.cs deleted file mode 100644 index bd3fa1ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles2.g.cs +++ /dev/null @@ -1,246 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareListFiles2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? after, - ref string? purpose, - ref string? order, - ref int? limit, - ref string? xiApiKey); - partial void PrepareListFiles2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? after, - string? purpose, - string? order, - int? limit, - string? xiApiKey); - partial void ProcessListFiles2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessListFiles2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// List Files - /// - /// - /// - /// - /// - /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ListFiles2Async( - string? after = default, - string? purpose = default, - string? order = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareListFiles2Arguments( - httpClient: HttpClient, - after: ref after, - purpose: ref purpose, - order: ref order, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/files", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("after", after) - .AddOptionalParameter("purpose", purpose) - .AddOptionalParameter("order", order) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListFiles2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - after: after, - purpose: purpose, - order: order, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListFiles2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessListFiles2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.LogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.LogsQuery.g.cs deleted file mode 100644 index 1d3f540d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.LogsQuery.g.cs +++ /dev/null @@ -1,339 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareLogsQueryArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? from, - ref string? to, - ref int? limit, - ref string? xiApiKey); - partial void PrepareLogsQueryRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? from, - string? to, - int? limit, - string? xiApiKey); - partial void ProcessLogsQueryResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessLogsQueryResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Logs Query
- /// Query inference logs.
- /// * Without timestamps (from/to) returns last `limit` messages (in last month).
- /// * With `from` only, returns first `limit` messages after `from` (inclusive).
- /// * With `to` only, returns last `limit` messages before `to` (inclusive).
- /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
- /// * `from` and `to` should be no more than a month apart. - ///
- /// - /// the deploy id to get the logs from - /// - /// - /// start of period, in fractional seconds since unix epoch (inclusive) - /// - /// - /// end of period, in fractional seconds since unix epoch (exclusive) - /// - /// - /// how many items to return at most (default 100, in [1, 1000])
- /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task LogsQueryAsync( - string deployId, - string? from = default, - string? to = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareLogsQueryArguments( - httpClient: HttpClient, - deployId: ref deployId, - from: ref from, - to: ref to, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/logs/query", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("deploy_id", deployId) - .AddOptionalParameter("from", from) - .AddOptionalParameter("to", to) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareLogsQueryRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - from: from, - to: to, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessLogsQueryResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessLogsQueryResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.LogQueryOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.LogQueryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Me.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Me.g.cs deleted file mode 100644 index 7691602f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Me.g.cs +++ /dev/null @@ -1,229 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareMeArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? checklist, - ref string? xiApiKey); - partial void PrepareMeRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? checklist, - string? xiApiKey); - partial void ProcessMeResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessMeResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Me - /// - /// - /// Default Value: false - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task MeAsync( - bool? checklist = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareMeArguments( - httpClient: HttpClient, - checklist: ref checklist, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("checklist", checklist?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareMeRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - checklist: checklist, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessMeResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessMeResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Me.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Me.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelDelete.g.cs deleted file mode 100644 index bd070177..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelDelete.g.cs +++ /dev/null @@ -1,307 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelDeleteArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string version, - ref string? xiApiKey); - partial void PrepareModelDeleteRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string version, - string? xiApiKey); - partial void ProcessModelDeleteResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelDeleteResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Delete - /// - /// - /// - /// delete a particular version, pass 'ALL' to wipe everything - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelDeleteAsync( - string modelName, - string version, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelDeleteArguments( - httpClient: HttpClient, - modelName: ref modelName, - version: ref version, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("version", version) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - version: version, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelDeleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamiliesNames.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamiliesNames.g.cs deleted file mode 100644 index 2e184ac6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamiliesNames.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelFamiliesNamesArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareModelFamiliesNamesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessModelFamiliesNamesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelFamiliesNamesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Families Names - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelFamiliesNamesAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelFamiliesNamesArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/model-families/names", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelFamiliesNamesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelFamiliesNamesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelFamiliesNamesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamily.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamily.g.cs deleted file mode 100644 index b9338d86..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamily.g.cs +++ /dev/null @@ -1,250 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelFamilyArguments( - global::System.Net.Http.HttpClient httpClient, - ref string familyName); - partial void PrepareModelFamilyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string familyName); - partial void ProcessModelFamilyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelFamilyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Family - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelFamilyAsync( - string familyName, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelFamilyArguments( - httpClient: HttpClient, - familyName: ref familyName); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/model-families/{familyName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelFamilyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - familyName: familyName); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelFamilyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelFamilyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ModelFamilyOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ModelFamilyOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelMetaUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelMetaUpdate.g.cs deleted file mode 100644 index e197edf0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelMetaUpdate.g.cs +++ /dev/null @@ -1,368 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelMetaUpdateArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? xiApiKey, - global::DeepInfra.ModelMetaIn request); - partial void PrepareModelMetaUpdateRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? xiApiKey, - global::DeepInfra.ModelMetaIn request); - partial void ProcessModelMetaUpdateResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelMetaUpdateResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Meta Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelMetaUpdateAsync( - string modelName, - - global::DeepInfra.ModelMetaIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareModelMetaUpdateArguments( - httpClient: HttpClient, - modelName: ref modelName, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}/meta", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelMetaUpdateRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelMetaUpdateResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelMetaUpdateResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Model Meta Update - /// - /// - /// - /// - /// short model description in plain text - /// - /// - /// source code project link (empty to delete) - /// - /// - /// paper/research link (empty to delete) - /// - /// - /// usage license link (empty to delete) - /// - /// - /// markdown flavored model readme - /// - /// - /// dataurl or regular url to cover image (empty to delete) - /// - /// - /// model type - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelMetaUpdateAsync( - string modelName, - string? xiApiKey = default, - string? description = default, - string? githubUrl = default, - string? paperUrl = default, - string? licenseUrl = default, - string? readme = default, - string? coverImgUrl = default, - global::DeepInfra.HFTasksE? reportedType = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ModelMetaIn - { - Description = description, - GithubUrl = githubUrl, - PaperUrl = paperUrl, - LicenseUrl = licenseUrl, - Readme = readme, - CoverImgUrl = coverImgUrl, - ReportedType = reportedType, - }; - - return await ModelMetaUpdateAsync( - modelName: modelName, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelPublicity.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelPublicity.g.cs deleted file mode 100644 index 08ff5277..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelPublicity.g.cs +++ /dev/null @@ -1,338 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelPublicityArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? xiApiKey, - global::DeepInfra.ModelPublicityIn request); - partial void PrepareModelPublicityRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? xiApiKey, - global::DeepInfra.ModelPublicityIn request); - partial void ProcessModelPublicityResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelPublicityResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Publicity - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelPublicityAsync( - string modelName, - - global::DeepInfra.ModelPublicityIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareModelPublicityArguments( - httpClient: HttpClient, - modelName: ref modelName, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}/publicity", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelPublicityRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelPublicityResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelPublicityResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Model Publicity - /// - /// - /// - /// - /// whether to make the model public of private - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelPublicityAsync( - string modelName, - bool @public, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ModelPublicityIn - { - Public = @public, - }; - - return await ModelPublicityAsync( - modelName: modelName, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelSchema.g.cs deleted file mode 100644 index 38e2b4bc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelSchema.g.cs +++ /dev/null @@ -1,353 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelSchemaArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref global::DeepInfra.SchemaVariantKey variantKey, - ref string? version, - ref string? xiApiKey); - partial void PrepareModelSchemaRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - global::DeepInfra.SchemaVariantKey variantKey, - string? version, - string? xiApiKey); - partial void ProcessModelSchemaResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelSchemaResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Schema - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelSchemaAsync( - string modelName, - global::DeepInfra.SchemaVariantKey variantKey, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelSchemaArguments( - httpClient: HttpClient, - modelName: ref modelName, - variantKey: ref variantKey, - version: ref version, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}/schema/{variantKey}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("version", version) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelSchemaRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - variantKey: variantKey, - version: version, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelSchemaResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Locked - if ((int)__response.StatusCode == 423) - { - string? __content_423 = null; - global::System.Exception? __exception_423 = null; - global::DeepInfra.DeepError? __value_423 = null; - try - { - if (ReadResponseAsString) - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - else - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_423 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_423, - statusCode: __response.StatusCode) - { - ResponseBody = __content_423, - ResponseObject = __value_423, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelSchemaResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.SchemaOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.SchemaOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelVersions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelVersions.g.cs deleted file mode 100644 index 5067500c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelVersions.g.cs +++ /dev/null @@ -1,262 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelVersionsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? xiApiKey); - partial void PrepareModelVersionsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? xiApiKey); - partial void ProcessModelVersionsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelVersionsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Versions - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelVersionsAsync( - string modelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelVersionsArguments( - httpClient: HttpClient, - modelName: ref modelName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}/versions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelVersionsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelVersionsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelVersionsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsDeploymentList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsDeploymentList.g.cs deleted file mode 100644 index 6cc8204e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsDeploymentList.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelsDeploymentListArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareModelsDeploymentListRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessModelsDeploymentListResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelsDeploymentListResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Models Deployment List - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelsDeploymentListAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelsDeploymentListArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/models/deployment/list", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelsDeploymentListRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelsDeploymentListResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelsDeploymentListResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsFeatured.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsFeatured.g.cs deleted file mode 100644 index b708c187..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsFeatured.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelsFeaturedArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareModelsFeaturedRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessModelsFeaturedResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelsFeaturedResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Models Featured - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelsFeaturedAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelsFeaturedArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/models/featured", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelsFeaturedRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelsFeaturedResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelsFeaturedResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsInfo.g.cs deleted file mode 100644 index 82866b1b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsInfo.g.cs +++ /dev/null @@ -1,271 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelsInfoArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? version, - ref string? xiApiKey); - partial void PrepareModelsInfoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? version, - string? xiApiKey); - partial void ProcessModelsInfoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelsInfoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Models Info - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelsInfoAsync( - string modelName, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelsInfoArguments( - httpClient: HttpClient, - modelName: ref modelName, - version: ref version, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("version", version) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelsInfoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - version: version, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelsInfoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelsInfoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ModelInfoOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ModelInfoOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsList.g.cs deleted file mode 100644 index aa41e38a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsList.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelsListArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareModelsListRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessModelsListResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelsListResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Models List - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelsListAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelsListArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/models/list", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelsListRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelsListResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelsListResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsLoraList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsLoraList.g.cs deleted file mode 100644 index da68f61c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsLoraList.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelsLoraListArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareModelsLoraListRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessModelsLoraListResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelsLoraListResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Models Lora List - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelsLoraListAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelsLoraListArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/models/lora/list", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelsLoraListRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelsLoraListResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelsLoraListResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OktaLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OktaLogin.g.cs deleted file mode 100644 index e09a071a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OktaLogin.g.cs +++ /dev/null @@ -1,225 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOktaLoginArguments( - global::System.Net.Http.HttpClient httpClient, - ref string teamId, - ref string? origin, - ref string? loginId); - partial void PrepareOktaLoginRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string teamId, - string? origin, - string? loginId); - partial void ProcessOktaLoginResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOktaLoginResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Okta Login - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OktaLoginAsync( - string teamId, - string? origin = default, - string? loginId = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareOktaLoginArguments( - httpClient: HttpClient, - teamId: ref teamId, - origin: ref origin, - loginId: ref loginId); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/okta/login", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("team_id", teamId) - .AddOptionalParameter("origin", origin) - .AddOptionalParameter("login_id", loginId) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOktaLoginRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - teamId: teamId, - origin: origin, - loginId: loginId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOktaLoginResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOktaLoginResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech.g.cs deleted file mode 100644 index cb7f5cec..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech.g.cs +++ /dev/null @@ -1,298 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioSpeechArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAITextToSpeechIn request); - partial void PrepareOpenaiAudioSpeechRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAITextToSpeechIn request); - partial void ProcessOpenaiAudioSpeechResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioSpeechResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioSpeechAsync( - - global::DeepInfra.OpenAITextToSpeechIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioSpeechArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/audio/speech", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioSpeechRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioSpeechResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioSpeechResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// Text to convert to speech - /// - /// - /// Preset voices to use for the speech. - /// - /// - /// response format for the speech
- /// Default Value: wav - /// - /// - /// speed of the speech
- /// Default Value: 1F - /// - /// - /// Extra body parameters for the model. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioSpeechAsync( - string model, - string input, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - string? voice = default, - global::DeepInfra.TtsResponseFormat? responseFormat = default, - double? speed = default, - object? extraBody = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAITextToSpeechIn - { - ServiceTier = serviceTier, - Model = model, - Input = input, - Voice = voice, - ResponseFormat = responseFormat, - Speed = speed, - ExtraBody = extraBody, - }; - - return await OpenaiAudioSpeechAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech2.g.cs deleted file mode 100644 index 57ead2d7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech2.g.cs +++ /dev/null @@ -1,298 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioSpeech2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAITextToSpeechIn request); - partial void PrepareOpenaiAudioSpeech2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAITextToSpeechIn request); - partial void ProcessOpenaiAudioSpeech2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioSpeech2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioSpeech2Async( - - global::DeepInfra.OpenAITextToSpeechIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioSpeech2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/audio/speech", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioSpeech2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioSpeech2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioSpeech2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// Text to convert to speech - /// - /// - /// Preset voices to use for the speech. - /// - /// - /// response format for the speech
- /// Default Value: wav - /// - /// - /// speed of the speech
- /// Default Value: 1F - /// - /// - /// Extra body parameters for the model. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioSpeech2Async( - string model, - string input, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - string? voice = default, - global::DeepInfra.TtsResponseFormat? responseFormat = default, - double? speed = default, - object? extraBody = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAITextToSpeechIn - { - ServiceTier = serviceTier, - Model = model, - Input = input, - Voice = voice, - ResponseFormat = responseFormat, - Speed = speed, - ExtraBody = extraBody, - }; - - return await OpenaiAudioSpeech2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions.g.cs deleted file mode 100644 index 60ae872e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions.g.cs +++ /dev/null @@ -1,346 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioTranscriptionsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request); - partial void PrepareOpenaiAudioTranscriptionsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request); - partial void ProcessOpenaiAudioTranscriptionsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioTranscriptionsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranscriptionsAsync( - - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioTranscriptionsArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/audio/transcriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xDeepinfraSource != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xDeepinfraSource}"), - name: "\"x-deepinfra-source\""); - } - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - if (request.Language != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Language}"), - name: "\"language\""); - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.ResponseFormat}"), - name: "\"response_format\""); - } - if (request.Temperature != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Temperature}"), - name: "\"temperature\""); - } - if (request.TimestampGranularities != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.TimestampGranularities}"), - name: "\"timestamp_granularities\""); - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioTranscriptionsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioTranscriptionsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioTranscriptionsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranscriptionsAsync( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? language = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Collections.Generic.IList? timestampGranularities = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost - { - File = file, - Filename = filename, - Model = model, - Language = language, - Prompt = prompt, - ResponseFormat = responseFormat, - Temperature = temperature, - TimestampGranularities = timestampGranularities, - }; - - return await OpenaiAudioTranscriptionsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions2.g.cs deleted file mode 100644 index 5d949b8e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions2.g.cs +++ /dev/null @@ -1,346 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioTranscriptions2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost request); - partial void PrepareOpenaiAudioTranscriptions2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost request); - partial void ProcessOpenaiAudioTranscriptions2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioTranscriptions2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranscriptions2Async( - - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioTranscriptions2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/audio/transcriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xDeepinfraSource != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xDeepinfraSource}"), - name: "\"x-deepinfra-source\""); - } - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - if (request.Language != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Language}"), - name: "\"language\""); - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.ResponseFormat}"), - name: "\"response_format\""); - } - if (request.Temperature != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Temperature}"), - name: "\"temperature\""); - } - if (request.TimestampGranularities != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.TimestampGranularities}"), - name: "\"timestamp_granularities\""); - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioTranscriptions2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioTranscriptions2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioTranscriptions2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranscriptions2Async( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? language = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Collections.Generic.IList? timestampGranularities = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost - { - File = file, - Filename = filename, - Model = model, - Language = language, - Prompt = prompt, - ResponseFormat = responseFormat, - Temperature = temperature, - TimestampGranularities = timestampGranularities, - }; - - return await OpenaiAudioTranscriptions2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations.g.cs deleted file mode 100644 index 1072a73f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations.g.cs +++ /dev/null @@ -1,326 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioTranslationsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request); - partial void PrepareOpenaiAudioTranslationsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request); - partial void ProcessOpenaiAudioTranslationsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioTranslationsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranslationsAsync( - - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioTranslationsArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/audio/translations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xDeepinfraSource != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xDeepinfraSource}"), - name: "\"x-deepinfra-source\""); - } - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.ResponseFormat}"), - name: "\"response_format\""); - } - if (request.Temperature != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Temperature}"), - name: "\"temperature\""); - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioTranslationsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioTranslationsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioTranslationsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranslationsAsync( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost - { - File = file, - Filename = filename, - Model = model, - Prompt = prompt, - ResponseFormat = responseFormat, - Temperature = temperature, - }; - - return await OpenaiAudioTranslationsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations2.g.cs deleted file mode 100644 index 3e1ab2a9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations2.g.cs +++ /dev/null @@ -1,326 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioTranslations2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost request); - partial void PrepareOpenaiAudioTranslations2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost request); - partial void ProcessOpenaiAudioTranslations2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioTranslations2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranslations2Async( - - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioTranslations2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/audio/translations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xDeepinfraSource != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xDeepinfraSource}"), - name: "\"x-deepinfra-source\""); - } - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.ResponseFormat}"), - name: "\"response_format\""); - } - if (request.Temperature != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Temperature}"), - name: "\"temperature\""); - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioTranslations2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioTranslations2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioTranslations2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranslations2Async( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost - { - File = file, - Filename = filename, - Model = model, - Prompt = prompt, - ResponseFormat = responseFormat, - Temperature = temperature, - }; - - return await OpenaiAudioTranslations2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions.g.cs deleted file mode 100644 index 38997412..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions.g.cs +++ /dev/null @@ -1,391 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiChatCompletionsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAIChatCompletionsIn request); - partial void PrepareOpenaiChatCompletionsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAIChatCompletionsIn request); - partial void ProcessOpenaiChatCompletionsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiChatCompletionsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiChatCompletionsAsync( - - global::DeepInfra.OpenAIChatCompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiChatCompletionsArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/chat/completions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiChatCompletionsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiChatCompletionsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiChatCompletionsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// model name - /// - /// - /// conversation messages: (user,assistant,tool)*,user including one system message anywhere - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// The maximum number of tokens to generate in the chat completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// A list of tools the model may call. Currently, only functions are supported as a tool. - /// - /// - /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. - /// - /// - /// streaming options - /// - /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. - /// - /// - /// Reasoning configuration. - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Chat template kwargs. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiChatCompletionsAsync( - string model, - global::System.Collections.Generic.IList> messages, - string? xDeepinfraSource = default, - string? xiApiKey = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? stop = default, - int? n = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnyOf? toolChoice = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - bool? logprobs = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, - global::DeepInfra.ChatReasoningSettings? reasoning = default, - string? promptCacheKey = default, - object? chatTemplateKwargs = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIChatCompletionsIn - { - Model = model, - Messages = messages, - Stream = stream, - Temperature = temperature, - TopP = topP, - MinP = minP, - TopK = topK, - MaxTokens = maxTokens, - Stop = stop, - N = n, - PresencePenalty = presencePenalty, - FrequencyPenalty = frequencyPenalty, - Tools = tools, - ToolChoice = toolChoice, - ResponseFormat = responseFormat, - RepetitionPenalty = repetitionPenalty, - User = user, - Seed = seed, - Logprobs = logprobs, - StreamOptions = streamOptions, - ReasoningEffort = reasoningEffort, - Reasoning = reasoning, - PromptCacheKey = promptCacheKey, - ChatTemplateKwargs = chatTemplateKwargs, - }; - - return await OpenaiChatCompletionsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions2.g.cs deleted file mode 100644 index 9ca20d01..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions2.g.cs +++ /dev/null @@ -1,391 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiChatCompletions2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAIChatCompletionsIn request); - partial void PrepareOpenaiChatCompletions2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAIChatCompletionsIn request); - partial void ProcessOpenaiChatCompletions2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiChatCompletions2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiChatCompletions2Async( - - global::DeepInfra.OpenAIChatCompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiChatCompletions2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/chat/completions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiChatCompletions2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiChatCompletions2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiChatCompletions2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// model name - /// - /// - /// conversation messages: (user,assistant,tool)*,user including one system message anywhere - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// The maximum number of tokens to generate in the chat completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// A list of tools the model may call. Currently, only functions are supported as a tool. - /// - /// - /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. - /// - /// - /// streaming options - /// - /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. - /// - /// - /// Reasoning configuration. - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Chat template kwargs. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiChatCompletions2Async( - string model, - global::System.Collections.Generic.IList> messages, - string? xDeepinfraSource = default, - string? xiApiKey = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? stop = default, - int? n = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnyOf? toolChoice = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - bool? logprobs = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, - global::DeepInfra.ChatReasoningSettings? reasoning = default, - string? promptCacheKey = default, - object? chatTemplateKwargs = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIChatCompletionsIn - { - Model = model, - Messages = messages, - Stream = stream, - Temperature = temperature, - TopP = topP, - MinP = minP, - TopK = topK, - MaxTokens = maxTokens, - Stop = stop, - N = n, - PresencePenalty = presencePenalty, - FrequencyPenalty = frequencyPenalty, - Tools = tools, - ToolChoice = toolChoice, - ResponseFormat = responseFormat, - RepetitionPenalty = repetitionPenalty, - User = user, - Seed = seed, - Logprobs = logprobs, - StreamOptions = streamOptions, - ReasoningEffort = reasoningEffort, - Reasoning = reasoning, - PromptCacheKey = promptCacheKey, - ChatTemplateKwargs = chatTemplateKwargs, - }; - - return await OpenaiChatCompletions2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions.g.cs deleted file mode 100644 index 4f4a4d17..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions.g.cs +++ /dev/null @@ -1,386 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiCompletionsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAICompletionsIn request); - partial void PrepareOpenaiCompletionsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAICompletionsIn request); - partial void ProcessOpenaiCompletionsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiCompletionsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiCompletionsAsync( - - global::DeepInfra.OpenAICompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiCompletionsArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/completions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiCompletionsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiCompletionsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiCompletionsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Completions - /// - /// - /// - /// - /// model name - /// - /// - /// input prompt - a single string is currently supported - /// - /// - /// The maximum number of tokens to generate in the completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// return top tokens and their log-probabilities - /// - /// - /// return prompt as part of the respons - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// streaming options - /// - /// - /// List of token IDs that will stop generation when encountered - /// - /// - /// return tokens as token ids - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiCompletionsAsync( - string model, - global::DeepInfra.AnyOf> prompt, - string? xDeepinfraSource = default, - string? xiApiKey = default, - int? maxTokens = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? n = default, - bool? stream = default, - int? logprobs = default, - bool? echo = default, - global::DeepInfra.AnyOf, object>? stop = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::System.Collections.Generic.IList? stopTokenIds = default, - bool? returnTokensAsTokenIds = default, - string? promptCacheKey = default, - global::DeepInfra.CompletionMultiModalData? data = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAICompletionsIn - { - Model = model, - Prompt = prompt, - MaxTokens = maxTokens, - Temperature = temperature, - TopP = topP, - MinP = minP, - TopK = topK, - N = n, - Stream = stream, - Logprobs = logprobs, - Echo = echo, - Stop = stop, - PresencePenalty = presencePenalty, - FrequencyPenalty = frequencyPenalty, - ResponseFormat = responseFormat, - RepetitionPenalty = repetitionPenalty, - User = user, - Seed = seed, - StreamOptions = streamOptions, - StopTokenIds = stopTokenIds, - ReturnTokensAsTokenIds = returnTokensAsTokenIds, - PromptCacheKey = promptCacheKey, - Data = data, - }; - - return await OpenaiCompletionsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions2.g.cs deleted file mode 100644 index 6144d6dc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions2.g.cs +++ /dev/null @@ -1,386 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiCompletions2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAICompletionsIn request); - partial void PrepareOpenaiCompletions2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAICompletionsIn request); - partial void ProcessOpenaiCompletions2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiCompletions2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiCompletions2Async( - - global::DeepInfra.OpenAICompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiCompletions2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/completions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiCompletions2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiCompletions2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiCompletions2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Completions - /// - /// - /// - /// - /// model name - /// - /// - /// input prompt - a single string is currently supported - /// - /// - /// The maximum number of tokens to generate in the completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// return top tokens and their log-probabilities - /// - /// - /// return prompt as part of the respons - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// streaming options - /// - /// - /// List of token IDs that will stop generation when encountered - /// - /// - /// return tokens as token ids - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiCompletions2Async( - string model, - global::DeepInfra.AnyOf> prompt, - string? xDeepinfraSource = default, - string? xiApiKey = default, - int? maxTokens = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? n = default, - bool? stream = default, - int? logprobs = default, - bool? echo = default, - global::DeepInfra.AnyOf, object>? stop = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::System.Collections.Generic.IList? stopTokenIds = default, - bool? returnTokensAsTokenIds = default, - string? promptCacheKey = default, - global::DeepInfra.CompletionMultiModalData? data = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAICompletionsIn - { - Model = model, - Prompt = prompt, - MaxTokens = maxTokens, - Temperature = temperature, - TopP = topP, - MinP = minP, - TopK = topK, - N = n, - Stream = stream, - Logprobs = logprobs, - Echo = echo, - Stop = stop, - PresencePenalty = presencePenalty, - FrequencyPenalty = frequencyPenalty, - ResponseFormat = responseFormat, - RepetitionPenalty = repetitionPenalty, - User = user, - Seed = seed, - StreamOptions = streamOptions, - StopTokenIds = stopTokenIds, - ReturnTokensAsTokenIds = returnTokensAsTokenIds, - PromptCacheKey = promptCacheKey, - Data = data, - }; - - return await OpenaiCompletions2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings.g.cs deleted file mode 100644 index e5e65758..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings.g.cs +++ /dev/null @@ -1,300 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiEmbeddingsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? userAgent, - ref string? xiApiKey, - global::DeepInfra.OpenAIEmbeddingsIn request); - partial void PrepareOpenaiEmbeddingsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? userAgent, - string? xiApiKey, - global::DeepInfra.OpenAIEmbeddingsIn request); - partial void ProcessOpenaiEmbeddingsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiEmbeddingsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiEmbeddingsAsync( - - global::DeepInfra.OpenAIEmbeddingsIn request, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiEmbeddingsArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - userAgent: ref userAgent, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/embeddings", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (userAgent != default) - { - __httpRequest.Headers.TryAddWithoutValidation("user-agent", userAgent.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiEmbeddingsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - userAgent: userAgent, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiEmbeddingsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiEmbeddingsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// sequences to embed - /// - /// - /// format used when encoding
- /// Default Value: float - /// - /// - /// The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiEmbeddingsAsync( - string model, - global::DeepInfra.AnyOf, string> input, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat = default, - int? dimensions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIEmbeddingsIn - { - ServiceTier = serviceTier, - Model = model, - Input = input, - EncodingFormat = encodingFormat, - Dimensions = dimensions, - }; - - return await OpenaiEmbeddingsAsync( - xDeepinfraSource: xDeepinfraSource, - userAgent: userAgent, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings2.g.cs deleted file mode 100644 index c0736e7f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings2.g.cs +++ /dev/null @@ -1,300 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiEmbeddings2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? userAgent, - ref string? xiApiKey, - global::DeepInfra.OpenAIEmbeddingsIn request); - partial void PrepareOpenaiEmbeddings2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? userAgent, - string? xiApiKey, - global::DeepInfra.OpenAIEmbeddingsIn request); - partial void ProcessOpenaiEmbeddings2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiEmbeddings2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiEmbeddings2Async( - - global::DeepInfra.OpenAIEmbeddingsIn request, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiEmbeddings2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - userAgent: ref userAgent, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/embeddings", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (userAgent != default) - { - __httpRequest.Headers.TryAddWithoutValidation("user-agent", userAgent.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiEmbeddings2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - userAgent: userAgent, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiEmbeddings2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiEmbeddings2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// sequences to embed - /// - /// - /// format used when encoding
- /// Default Value: float - /// - /// - /// The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiEmbeddings2Async( - string model, - global::DeepInfra.AnyOf, string> input, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat = default, - int? dimensions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIEmbeddingsIn - { - ServiceTier = serviceTier, - Model = model, - Input = input, - EncodingFormat = encodingFormat, - Dimensions = dimensions, - }; - - return await OpenaiEmbeddings2Async( - xDeepinfraSource: xDeepinfraSource, - userAgent: userAgent, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles.g.cs deleted file mode 100644 index 63ba6d88..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles.g.cs +++ /dev/null @@ -1,272 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiFilesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiFilesV1FilesPost request); - partial void PrepareOpenaiFilesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiFilesV1FilesPost request); - partial void ProcessOpenaiFilesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiFilesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Files - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiFilesAsync( - - global::DeepInfra.BodyOpenaiFilesV1FilesPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiFilesArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/files", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Purpose}"), - name: "\"purpose\""); - for (var __iFile = 0; __iFile < request.File.Count; __iFile++) - { - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File[__iFile]); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: $"\"file{__iFile}.bin\""); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiFilesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiFilesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiFilesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Files - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiFilesAsync( - string purpose, - global::System.Collections.Generic.IList file, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiFilesV1FilesPost - { - Purpose = purpose, - File = file, - }; - - return await OpenaiFilesAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles2.g.cs deleted file mode 100644 index 88dc83a9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles2.g.cs +++ /dev/null @@ -1,272 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiFiles2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost request); - partial void PrepareOpenaiFiles2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost request); - partial void ProcessOpenaiFiles2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiFiles2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Files - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiFiles2Async( - - global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiFiles2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/files", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Purpose}"), - name: "\"purpose\""); - for (var __iFile = 0; __iFile < request.File.Count; __iFile++) - { - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File[__iFile]); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: $"\"file{__iFile}.bin\""); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiFiles2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiFiles2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiFiles2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Files - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiFiles2Async( - string purpose, - global::System.Collections.Generic.IList file, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost - { - Purpose = purpose, - File = file, - }; - - return await OpenaiFiles2Async( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits.g.cs deleted file mode 100644 index debf7995..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits.g.cs +++ /dev/null @@ -1,294 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesEditsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request); - partial void PrepareOpenaiImagesEditsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request); - partial void ProcessOpenaiImagesEditsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesEditsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesEditsAsync( - - global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesEditsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/images/edits", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - if (request.Inp != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Inp}"), - name: "\"inp\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesEditsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesEditsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesEditsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesEditsAsync( - byte[] image, - string imagename, - string prompt, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesEditsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost - { - Image = image, - Imagename = imagename, - Inp = inp, - Prompt = prompt, - Model = model, - }; - - return await OpenaiImagesEditsAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits2.g.cs deleted file mode 100644 index 67197f4c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits2.g.cs +++ /dev/null @@ -1,294 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesEdits2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost request); - partial void PrepareOpenaiImagesEdits2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost request); - partial void ProcessOpenaiImagesEdits2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesEdits2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesEdits2Async( - - global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesEdits2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/images/edits", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - if (request.Inp != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Inp}"), - name: "\"inp\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesEdits2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesEdits2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesEdits2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesEdits2Async( - byte[] image, - string imagename, - string prompt, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesEditsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost - { - Image = image, - Imagename = imagename, - Inp = inp, - Prompt = prompt, - Model = model, - }; - - return await OpenaiImagesEdits2Async( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations.g.cs deleted file mode 100644 index b343b091..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations.g.cs +++ /dev/null @@ -1,297 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesGenerationsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.OpenAIImagesGenerationsIn request); - partial void PrepareOpenaiImagesGenerationsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.OpenAIImagesGenerationsIn request); - partial void ProcessOpenaiImagesGenerationsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesGenerationsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesGenerationsAsync( - - global::DeepInfra.OpenAIImagesGenerationsIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesGenerationsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/images/generations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesGenerationsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesGenerationsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesGenerationsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The model to use for image generation. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The format in which the generated images are returned. Currently only b64_json is supported.
- /// Default Value: b64_json - /// - /// - /// The size of the generated images. Available sizes depend on the model.
- /// Default Value: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - /// - /// A text description of desired image(s). - /// - /// - /// The quality of the image that will be generated. - /// - /// - /// The style of the generated images. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesGenerationsAsync( - string model, - string prompt, - string? xiApiKey = default, - int? n = default, - global::DeepInfra.OpenAIImagesResponseFormat? responseFormat = default, - string? size = default, - string? user = default, - string? quality = default, - string? style = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIImagesGenerationsIn - { - Model = model, - N = n, - ResponseFormat = responseFormat, - Size = size, - User = user, - Prompt = prompt, - Quality = quality, - Style = style, - }; - - return await OpenaiImagesGenerationsAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations2.g.cs deleted file mode 100644 index ae1af47b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations2.g.cs +++ /dev/null @@ -1,297 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesGenerations2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.OpenAIImagesGenerationsIn request); - partial void PrepareOpenaiImagesGenerations2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.OpenAIImagesGenerationsIn request); - partial void ProcessOpenaiImagesGenerations2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesGenerations2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesGenerations2Async( - - global::DeepInfra.OpenAIImagesGenerationsIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesGenerations2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/images/generations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesGenerations2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesGenerations2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesGenerations2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The model to use for image generation. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The format in which the generated images are returned. Currently only b64_json is supported.
- /// Default Value: b64_json - /// - /// - /// The size of the generated images. Available sizes depend on the model.
- /// Default Value: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - /// - /// A text description of desired image(s). - /// - /// - /// The quality of the image that will be generated. - /// - /// - /// The style of the generated images. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesGenerations2Async( - string model, - string prompt, - string? xiApiKey = default, - int? n = default, - global::DeepInfra.OpenAIImagesResponseFormat? responseFormat = default, - string? size = default, - string? user = default, - string? quality = default, - string? style = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIImagesGenerationsIn - { - Model = model, - N = n, - ResponseFormat = responseFormat, - Size = size, - User = user, - Prompt = prompt, - Quality = quality, - Style = style, - }; - - return await OpenaiImagesGenerations2Async( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations.g.cs deleted file mode 100644 index caa5f7c4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations.g.cs +++ /dev/null @@ -1,288 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesVariationsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request); - partial void PrepareOpenaiImagesVariationsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request); - partial void ProcessOpenaiImagesVariationsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesVariationsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesVariationsAsync( - - global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesVariationsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/images/variations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - if (request.Inp != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Inp}"), - name: "\"inp\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesVariationsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesVariationsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesVariationsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesVariationsAsync( - byte[] image, - string imagename, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesVariationsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost - { - Image = image, - Imagename = imagename, - Inp = inp, - Model = model, - }; - - return await OpenaiImagesVariationsAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations2.g.cs deleted file mode 100644 index 659254ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations2.g.cs +++ /dev/null @@ -1,288 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesVariations2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost request); - partial void PrepareOpenaiImagesVariations2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost request); - partial void ProcessOpenaiImagesVariations2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesVariations2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesVariations2Async( - - global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesVariations2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/images/variations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - if (request.Inp != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Inp}"), - name: "\"inp\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesVariations2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesVariations2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesVariations2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesVariations2Async( - byte[] image, - string imagename, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesVariationsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost - { - Image = image, - Imagename = imagename, - Inp = inp, - Model = model, - }; - - return await OpenaiImagesVariations2Async( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels.g.cs deleted file mode 100644 index f37b2e97..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiModelsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareOpenaiModelsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessOpenaiModelsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiModelsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Models - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiModelsAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareOpenaiModelsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/models", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiModelsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiModelsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiModelsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIModelsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIModelsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels2.g.cs deleted file mode 100644 index fad67dca..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels2.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiModels2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareOpenaiModels2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessOpenaiModels2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiModels2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Models - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiModels2Async( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareOpenaiModels2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/models", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiModels2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiModels2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiModels2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIModelsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIModelsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenrouterModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenrouterModels.g.cs deleted file mode 100644 index 770c2488..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenrouterModels.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenrouterModelsArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareOpenrouterModelsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessOpenrouterModelsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenrouterModelsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openrouter Models - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenrouterModelsAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareOpenrouterModelsArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/openrouter/models", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenrouterModelsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenrouterModelsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenrouterModelsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenRouterModelsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenRouterModelsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.PrivateModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.PrivateModelsList.g.cs deleted file mode 100644 index 24c09cb9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.PrivateModelsList.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PreparePrivateModelsListArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PreparePrivateModelsListRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessPrivateModelsListResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPrivateModelsListResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Private Models List - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PrivateModelsListAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PreparePrivateModelsListArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/models/private/list", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePrivateModelsListRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPrivateModelsListResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPrivateModelsListResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RentGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RentGpuAvailability.g.cs deleted file mode 100644 index 8ca72882..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RentGpuAvailability.g.cs +++ /dev/null @@ -1,234 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRentGpuAvailabilityArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? source, - ref string? baseModel, - ref string? xiApiKey); - partial void PrepareRentGpuAvailabilityRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? source, - string? baseModel, - string? xiApiKey); - partial void ProcessRentGpuAvailabilityResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRentGpuAvailabilityResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Rent Gpu Availability - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RentGpuAvailabilityAsync( - string? source = default, - string? baseModel = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRentGpuAvailabilityArguments( - httpClient: HttpClient, - source: ref source, - baseModel: ref baseModel, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/containers/gpu_availability", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("source", source) - .AddOptionalParameter("base_model", baseModel) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRentGpuAvailabilityRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - source: source, - baseModel: baseModel, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRentGpuAvailabilityResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRentGpuAvailabilityResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployGPUAvailability.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployGPUAvailability.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestGpuLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestGpuLimitIncrease.g.cs deleted file mode 100644 index 589a2d9c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestGpuLimitIncrease.g.cs +++ /dev/null @@ -1,333 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRequestGpuLimitIncreaseArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.GpuLimitRequestIn request); - partial void PrepareRequestGpuLimitIncreaseRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.GpuLimitRequestIn request); - partial void ProcessRequestGpuLimitIncreaseResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRequestGpuLimitIncreaseResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Request Gpu Limit Increase - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( - - global::DeepInfra.GpuLimitRequestIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareRequestGpuLimitIncreaseArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/gpu_limit/request", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRequestGpuLimitIncreaseRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRequestGpuLimitIncreaseResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRequestGpuLimitIncreaseResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Request Gpu Limit Increase - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( - string gpuType, - int requestedLimit, - string reason, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.GpuLimitRequestIn - { - GpuType = gpuType, - RequestedLimit = requestedLimit, - Reason = reason, - }; - - return await RequestGpuLimitIncreaseAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestRateLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestRateLimitIncrease.g.cs deleted file mode 100644 index d92ca2b3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestRateLimitIncrease.g.cs +++ /dev/null @@ -1,333 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRequestRateLimitIncreaseArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.RateLimitRequestIn request); - partial void PrepareRequestRateLimitIncreaseRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.RateLimitRequestIn request); - partial void ProcessRequestRateLimitIncreaseResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRequestRateLimitIncreaseResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Request Rate Limit Increase - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RequestRateLimitIncreaseAsync( - - global::DeepInfra.RateLimitRequestIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareRequestRateLimitIncreaseArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/rate_limit/request", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRequestRateLimitIncreaseRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRequestRateLimitIncreaseResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRequestRateLimitIncreaseResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Request Rate Limit Increase - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RequestRateLimitIncreaseAsync( - int rateLimit, - string reason, - string? xiApiKey = default, - int? tpmRateLimit = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.RateLimitRequestIn - { - RateLimit = rateLimit, - TpmRateLimit = tpmRateLimit, - Reason = reason, - }; - - return await RequestRateLimitIncreaseAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch.g.cs deleted file mode 100644 index 6d65618d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRetrieveOpenaiBatchArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId, - ref string? xiApiKey); - partial void PrepareRetrieveOpenaiBatchRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId, - string? xiApiKey); - partial void ProcessRetrieveOpenaiBatchResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRetrieveOpenaiBatchResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RetrieveOpenaiBatchAsync( - string batchId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRetrieveOpenaiBatchArguments( - httpClient: HttpClient, - batchId: ref batchId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/batches/{batchId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRetrieveOpenaiBatchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRetrieveOpenaiBatchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRetrieveOpenaiBatchResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch2.g.cs deleted file mode 100644 index a3ee7bdb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch2.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRetrieveOpenaiBatch2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId, - ref string? xiApiKey); - partial void PrepareRetrieveOpenaiBatch2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId, - string? xiApiKey); - partial void ProcessRetrieveOpenaiBatch2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRetrieveOpenaiBatch2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RetrieveOpenaiBatch2Async( - string batchId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRetrieveOpenaiBatch2Arguments( - httpClient: HttpClient, - batchId: ref batchId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/openai/batches/{batchId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRetrieveOpenaiBatch2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRetrieveOpenaiBatch2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRetrieveOpenaiBatch2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches.g.cs deleted file mode 100644 index 2629fb0d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRetrieveOpenaiBatchesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string after, - ref int? limit, - ref string? xiApiKey); - partial void PrepareRetrieveOpenaiBatchesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string after, - int? limit, - string? xiApiKey); - partial void ProcessRetrieveOpenaiBatchesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRetrieveOpenaiBatchesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve Openai Batches - /// - /// - /// - /// Default Value: 20 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RetrieveOpenaiBatchesAsync( - string after, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRetrieveOpenaiBatchesArguments( - httpClient: HttpClient, - after: ref after, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/batches", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("after", after) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRetrieveOpenaiBatchesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - after: after, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRetrieveOpenaiBatchesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRetrieveOpenaiBatchesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches2.g.cs deleted file mode 100644 index c65f4c12..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches2.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRetrieveOpenaiBatches2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string after, - ref int? limit, - ref string? xiApiKey); - partial void PrepareRetrieveOpenaiBatches2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string after, - int? limit, - string? xiApiKey); - partial void ProcessRetrieveOpenaiBatches2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRetrieveOpenaiBatches2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve Openai Batches - /// - /// - /// - /// Default Value: 20 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RetrieveOpenaiBatches2Async( - string after, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRetrieveOpenaiBatches2Arguments( - httpClient: HttpClient, - after: ref after, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/batches", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("after", after) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRetrieveOpenaiBatches2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - after: after, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRetrieveOpenaiBatches2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRetrieveOpenaiBatches2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetConfig.g.cs deleted file mode 100644 index 23554d53..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetConfig.g.cs +++ /dev/null @@ -1,251 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareSetConfigArguments( - global::System.Net.Http.HttpClient httpClient, - object? session, - global::DeepInfra.ConfigIn request); - partial void PrepareSetConfigRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - object? session, - global::DeepInfra.ConfigIn request); - partial void ProcessSetConfigResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessSetConfigResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Set Config - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SetConfigAsync( - - global::DeepInfra.ConfigIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareSetConfigArguments( - httpClient: HttpClient, - session: session, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/config", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareSetConfigRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - session: session, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessSetConfigResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessSetConfigResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ConfigOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ConfigOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Set Config - /// - /// - /// - /// Set usage limit (in USD). Negative means no limit.null/not-set means don't change it - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SetConfigAsync( - object? session = default, - double? limit = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ConfigIn - { - Limit = limit, - }; - - return await SetConfigAsync( - session: session, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetupTopup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetupTopup.g.cs deleted file mode 100644 index 893a8fca..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetupTopup.g.cs +++ /dev/null @@ -1,260 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareSetupTopupArguments( - global::System.Net.Http.HttpClient httpClient, - object? session, - global::DeepInfra.TopUpIn request); - partial void PrepareSetupTopupRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - object? session, - global::DeepInfra.TopUpIn request); - partial void ProcessSetupTopupResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessSetupTopupResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Setup Topup - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SetupTopupAsync( - - global::DeepInfra.TopUpIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareSetupTopupArguments( - httpClient: HttpClient, - session: session, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/topup", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareSetupTopupRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - session: session, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessSetupTopupResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessSetupTopupResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Setup Topup - /// - /// - /// - /// Amount to top up in cents
- /// Default Value: 0 - /// - /// - /// Top up threshold in cents, if balance goes below this value, top up will be triggered
- /// Default Value: 0 - /// - /// - /// If true, top up will be triggered when balance goes below threshold
- /// Default Value: true - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SetupTopupAsync( - object? session = default, - int? amount = default, - int? threshold = default, - bool? enabled = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.TopUpIn - { - Amount = amount, - Threshold = threshold, - Enabled = enabled, - }; - - return await SetupTopupAsync( - session: session, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SubmitFeedback.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SubmitFeedback.g.cs deleted file mode 100644 index fb350348..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SubmitFeedback.g.cs +++ /dev/null @@ -1,298 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareSubmitFeedbackArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.FeedbackIn request); - partial void PrepareSubmitFeedbackRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.FeedbackIn request); - partial void ProcessSubmitFeedbackResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessSubmitFeedbackResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Submit Feedback
- /// Submit feedback - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SubmitFeedbackAsync( - - global::DeepInfra.FeedbackIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareSubmitFeedbackArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/feedback", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareSubmitFeedbackRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessSubmitFeedbackResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessSubmitFeedbackResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Submit Feedback
- /// Submit feedback - ///
- /// - /// - /// The message you'd like to send to deepinfra team - /// - /// - /// Optional contact email to reach you back - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SubmitFeedbackAsync( - string message, - string? xiApiKey = default, - string? contactEmail = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.FeedbackIn - { - Message = message, - ContactEmail = contactEmail, - }; - - return await SubmitFeedbackAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TeamSetDisplayName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TeamSetDisplayName.g.cs deleted file mode 100644 index 7279bb03..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TeamSetDisplayName.g.cs +++ /dev/null @@ -1,329 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareTeamSetDisplayNameArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.DisplayNameIn request); - partial void PrepareTeamSetDisplayNameRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.DisplayNameIn request); - partial void ProcessTeamSetDisplayNameResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTeamSetDisplayNameResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Team Set Display Name - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TeamSetDisplayNameAsync( - - global::DeepInfra.DisplayNameIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTeamSetDisplayNameArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/team_display_name", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTeamSetDisplayNameRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTeamSetDisplayNameResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTeamSetDisplayNameResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Team Set Display Name - /// - /// - /// - /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TeamSetDisplayNameAsync( - string displayName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.DisplayNameIn - { - DisplayName = displayName, - }; - - return await TeamSetDisplayNameAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeech.g.cs deleted file mode 100644 index 11ef44b6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeech.g.cs +++ /dev/null @@ -1,291 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareTextToSpeechArguments( - global::System.Net.Http.HttpClient httpClient, - ref string voiceId, - ref string? outputFormat, - ref string? xiApiKey, - global::DeepInfra.ElevenLabsTextToSpeechIn request); - partial void PrepareTextToSpeechRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string voiceId, - string? outputFormat, - string? xiApiKey, - global::DeepInfra.ElevenLabsTextToSpeechIn request); - partial void ProcessTextToSpeechResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTextToSpeechResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Text To Speech - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TextToSpeechAsync( - string voiceId, - - global::DeepInfra.ElevenLabsTextToSpeechIn request, - string? outputFormat = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTextToSpeechArguments( - httpClient: HttpClient, - voiceId: ref voiceId, - outputFormat: ref outputFormat, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/text-to-speech/{voiceId}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("output_format", outputFormat) - ; - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTextToSpeechRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - voiceId: voiceId, - outputFormat: outputFormat, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTextToSpeechResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTextToSpeechResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Text To Speech - /// - /// - /// - /// - /// - /// Text to convert to speech - /// - /// - /// Model ID to use for the conversion
- /// Default Value: hexgrad/Kokoro-82M - /// - /// - /// Output format for the speech
- /// Default Value: wav - /// - /// - /// ISO 639-1, 2 letter language code - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TextToSpeechAsync( - string voiceId, - string text, - string? outputFormat = default, - string? xiApiKey = default, - string? modelId = default, - global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, - string? languageCode = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ElevenLabsTextToSpeechIn - { - Text = text, - ModelId = modelId, - OutputFormat = requestOutputFormat, - LanguageCode = languageCode, - }; - - return await TextToSpeechAsync( - voiceId: voiceId, - outputFormat: outputFormat, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeechStream.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeechStream.g.cs deleted file mode 100644 index 47354a47..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeechStream.g.cs +++ /dev/null @@ -1,291 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareTextToSpeechStreamArguments( - global::System.Net.Http.HttpClient httpClient, - ref string voiceId, - ref string? outputFormat, - ref string? xiApiKey, - global::DeepInfra.ElevenLabsTextToSpeechIn request); - partial void PrepareTextToSpeechStreamRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string voiceId, - string? outputFormat, - string? xiApiKey, - global::DeepInfra.ElevenLabsTextToSpeechIn request); - partial void ProcessTextToSpeechStreamResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTextToSpeechStreamResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Text To Speech Stream - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TextToSpeechStreamAsync( - string voiceId, - - global::DeepInfra.ElevenLabsTextToSpeechIn request, - string? outputFormat = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTextToSpeechStreamArguments( - httpClient: HttpClient, - voiceId: ref voiceId, - outputFormat: ref outputFormat, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/text-to-speech/{voiceId}/stream", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("output_format", outputFormat) - ; - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTextToSpeechStreamRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - voiceId: voiceId, - outputFormat: outputFormat, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTextToSpeechStreamResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTextToSpeechStreamResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Text To Speech Stream - /// - /// - /// - /// - /// - /// Text to convert to speech - /// - /// - /// Model ID to use for the conversion
- /// Default Value: hexgrad/Kokoro-82M - /// - /// - /// Output format for the speech
- /// Default Value: wav - /// - /// - /// ISO 639-1, 2 letter language code - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TextToSpeechStreamAsync( - string voiceId, - string text, - string? outputFormat = default, - string? xiApiKey = default, - string? modelId = default, - global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, - string? languageCode = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ElevenLabsTextToSpeechIn - { - Text = text, - ModelId = modelId, - OutputFormat = requestOutputFormat, - LanguageCode = languageCode, - }; - - return await TextToSpeechStreamAsync( - voiceId: voiceId, - outputFormat: outputFormat, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateLora.g.cs deleted file mode 100644 index 457328bf..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateLora.g.cs +++ /dev/null @@ -1,263 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUpdateLoraArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loraName, - ref string? xiApiKey, - global::DeepInfra.UpdateLoraApiRequest request); - partial void PrepareUpdateLoraRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loraName, - string? xiApiKey, - global::DeepInfra.UpdateLoraApiRequest request); - partial void ProcessUpdateLoraResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUpdateLoraResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Update Lora - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateLoraAsync( - string loraName, - - global::DeepInfra.UpdateLoraApiRequest request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareUpdateLoraArguments( - httpClient: HttpClient, - loraName: ref loraName, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/lora/{loraName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUpdateLoraRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loraName: loraName, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateLoraResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateLoraResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Update Lora - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateLoraAsync( - string loraName, - string? xiApiKey = default, - bool? @private = default, - string? description = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.UpdateLoraApiRequest - { - Private = @private, - Description = description, - }; - - return await UpdateLoraAsync( - loraName: loraName, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateVoice.g.cs deleted file mode 100644 index 9d9384a4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateVoice.g.cs +++ /dev/null @@ -1,343 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUpdateVoiceArguments( - global::System.Net.Http.HttpClient httpClient, - ref string voiceId, - ref string? xiApiKey, - global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request); - partial void PrepareUpdateVoiceRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string voiceId, - string? xiApiKey, - global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request); - partial void ProcessUpdateVoiceResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUpdateVoiceResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Update Voice - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateVoiceAsync( - string voiceId, - - global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareUpdateVoiceArguments( - httpClient: HttpClient, - voiceId: ref voiceId, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/voices/{voiceId}/edit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/x-www-form-urlencoded"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUpdateVoiceRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - voiceId: voiceId, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateVoiceResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateVoiceResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Update Voice - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateVoiceAsync( - string voiceId, - string name, - string description, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost - { - Name = name, - Description = description, - }; - - return await UpdateVoiceAsync( - voiceId: voiceId, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UploadLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UploadLoraModel.g.cs deleted file mode 100644 index ce8cded0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UploadLoraModel.g.cs +++ /dev/null @@ -1,302 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUploadLoraModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.LoraModelUploadIn request); - partial void PrepareUploadLoraModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.LoraModelUploadIn request); - partial void ProcessUploadLoraModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUploadLoraModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upload Lora Model - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UploadLoraModelAsync( - - global::DeepInfra.LoraModelUploadIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareUploadLoraModelArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/lora-model", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using 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") - { - __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); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - 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; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUploadLoraModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUploadLoraModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUploadLoraModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Upload Lora Model - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UploadLoraModelAsync( - string hfModelName, - string loraModelName, - string? xiApiKey = default, - string? hfToken = default, - string? baseModelName = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.LoraModelUploadIn - { - HfModelName = hfModelName, - HfToken = hfToken, - LoraModelName = loraModelName, - BaseModelName = baseModelName, - }; - - return await UploadLoraModelAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Usage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Usage.g.cs deleted file mode 100644 index 82161e61..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Usage.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUsageArguments( - global::System.Net.Http.HttpClient httpClient, - ref string from, - ref string? to, - object? session); - partial void PrepareUsageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string from, - string? to, - object? session); - partial void ProcessUsageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUsageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Usage - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UsageAsync( - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareUsageArguments( - httpClient: HttpClient, - from: ref from, - to: ref to, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/usage", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUsageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - from: from, - to: to, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUsageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUsageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageApiToken.g.cs deleted file mode 100644 index 30bc3678..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageApiToken.g.cs +++ /dev/null @@ -1,238 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUsageApiTokenArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiToken, - ref string from, - ref string? to, - object? session); - partial void PrepareUsageApiTokenRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiToken, - string from, - string? to, - object? session); - partial void ProcessUsageApiTokenResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUsageApiTokenResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Usage Api Token - /// - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UsageApiTokenAsync( - string apiToken, - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareUsageApiTokenArguments( - httpClient: HttpClient, - apiToken: ref apiToken, - from: ref from, - to: ref to, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/payment/usage/{apiToken}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUsageApiTokenRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiToken: apiToken, - from: from, - to: to, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUsageApiTokenResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUsageApiTokenResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageRent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageRent.g.cs deleted file mode 100644 index c9fee5d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageRent.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUsageRentArguments( - global::System.Net.Http.HttpClient httpClient, - ref int from, - int? to, - object? session); - partial void PrepareUsageRentRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - int from, - int? to, - object? session); - partial void ProcessUsageRentResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUsageRentResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Usage Rent - /// - /// - /// start of period, in seconds since unix epoch - /// - /// - /// end of period, in seconds since unix epoch - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UsageRentAsync( - int from, - int? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareUsageRentArguments( - httpClient: HttpClient, - from: ref from, - to: to, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/usage/rent", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from.ToString()!) - .AddOptionalParameter("to", to?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUsageRentRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - from: from, - to: to, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUsageRentResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUsageRentResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.UsageRentOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.UsageRentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageTokens.g.cs deleted file mode 100644 index e21b88e4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageTokens.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUsageTokensArguments( - global::System.Net.Http.HttpClient httpClient, - ref string from, - ref string? to, - object? session); - partial void PrepareUsageTokensRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string from, - string? to, - object? session); - partial void ProcessUsageTokensResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUsageTokensResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Usage Tokens - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UsageTokensAsync( - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareUsageTokensArguments( - httpClient: HttpClient, - from: ref from, - to: ref to, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/usage/tokens", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - 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") - { - __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); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUsageTokensRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - from: from, - to: to, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUsageTokensResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUsageTokensResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - 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 - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.g.cs index eff64c8b..021d792a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.g.cs @@ -4,6 +4,7 @@ namespace DeepInfra { /// + /// The DeepInfra API provides serverless AI inference, custom model deployments, and GPU rentals.
/// 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. ///
@@ -30,12 +31,177 @@ public sealed partial class DeepInfraClient : global::DeepInfra.IDeepInfraClient #if DEBUG = true; #endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } /// /// /// public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + /// + /// User profile, team management, and rate limits. + /// + public AccountClient Account => new AccountClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Manage agent-framework instances (OpenClaw and friends). + /// + public AgentsClient Agents => new AgentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// OpenAI-compatible speech synthesis, transcription, and translation. + /// + public AudioClient Audio => new AudioClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// API tokens, SSH keys, scoped JWTs, and login flows. + /// + public AuthenticationClient Authentication => new AuthenticationClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Payment methods, usage tracking, and billing. + /// + public BillingClient Billing => new BillingClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// OpenAI and Anthropic-compatible chat completion endpoints for LLMs. + /// + public ChatCompletionsClient ChatCompletions => new ChatCompletionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Deploy and manage private model instances with autoscaling. + /// + public DedicatedModelsClient DedicatedModels => new DedicatedModelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Generate text embeddings for search and RAG. + /// + public EmbeddingsClient Embeddings => new EmbeddingsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// File uploads and batch processing. + /// + public FilesBatchesClient FilesBatches => new FilesBatchesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Rent dedicated GPU containers. + /// + public GpuRentalsClient GpuRentals => new GpuRentalsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Generate, edit, and create variations of images. + /// + public ImageGenerationClient ImageGeneration => new ImageGenerationClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Native DeepInfra inference API for models and deployments. + /// + public InferenceClient Inference => new InferenceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Create, manage, and query LoRA adapter models. + /// + public LoRAAdaptersClient LoRAAdapters => new LoRAAdaptersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Query inference logs, deployment logs, and usage metrics. + /// + public LogsMetricsClient LogsMetrics => new LogsMetricsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Browse, search, and manage AI models. + /// + public ModelsClient Models => new ModelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// OpenAI-compatible text completion endpoints. + /// + public TextCompletionsClient TextCompletions => new TextCompletionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// ElevenLabs-compatible TTS endpoints and voice management. + /// + public TextToSpeechClient TextToSpeech => new TextToSpeechClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Feedback submission and CLI version. + /// + public UtilitiesClient Utilities => new UtilitiesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + /// /// Creates a new instance of the DeepInfraClient. /// If no httpClient is provided, a new one will be created. @@ -49,11 +215,58 @@ public DeepInfraClient( 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 DeepInfraClient 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 DeepInfraClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the DeepInfraClient. + /// 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 DeepInfraClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.AutoSDKClientOptions(); _disposeHttpClient = disposeHttpClient; Initialized(HttpClient); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.EmbeddingsClient.OpenaiEmbeddings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.EmbeddingsClient.OpenaiEmbeddings.g.cs new file mode 100644 index 00000000..35bb02db --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.EmbeddingsClient.OpenaiEmbeddings.g.cs @@ -0,0 +1,563 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class EmbeddingsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiEmbeddingsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiEmbeddingsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiEmbeddingsSecurityRequirement0, + }; + partial void PrepareOpenaiEmbeddingsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xDeepinfraSource, + ref string? userAgent, + ref string? xiApiKey, + global::DeepInfra.OpenAIEmbeddingsIn request); + partial void PrepareOpenaiEmbeddingsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? userAgent, + string? xiApiKey, + global::DeepInfra.OpenAIEmbeddingsIn request); + partial void ProcessOpenaiEmbeddingsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiEmbeddingsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Embeddings + /// + /// + /// + /// + /// + /// 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 OpenaiEmbeddingsAsync( + + global::DeepInfra.OpenAIEmbeddingsIn request, + string? xDeepinfraSource = default, + string? userAgent = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiEmbeddingsAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + userAgent: userAgent, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Embeddings + /// + /// + /// + /// + /// + /// 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> OpenaiEmbeddingsAsResponseAsync( + + global::DeepInfra.OpenAIEmbeddingsIn request, + string? xDeepinfraSource = default, + string? userAgent = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenaiEmbeddingsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + userAgent: ref userAgent, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiEmbeddingsSecurityRequirements, + operationName: "OpenaiEmbeddingsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/embeddings", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + if (userAgent != default) + { + __httpRequest.Headers.TryAddWithoutValidation("user-agent", userAgent.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiEmbeddingsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + userAgent: userAgent, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiEmbeddings", + methodName: "OpenaiEmbeddingsAsync", + pathTemplate: "\"/v1/embeddings\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiEmbeddings", + methodName: "OpenaiEmbeddingsAsync", + pathTemplate: "\"/v1/embeddings\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiEmbeddings", + methodName: "OpenaiEmbeddingsAsync", + pathTemplate: "\"/v1/embeddings\"", + 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::DeepInfra.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); + ProcessOpenaiEmbeddingsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiEmbeddings", + methodName: "OpenaiEmbeddingsAsync", + pathTemplate: "\"/v1/embeddings\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiEmbeddings", + methodName: "OpenaiEmbeddingsAsync", + pathTemplate: "\"/v1/embeddings\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiEmbeddingsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Embeddings + /// + /// + /// + /// + /// + /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// model name + /// + /// + /// sequences to embed + /// + /// + /// format used when encoding
+ /// Default Value: float + /// + /// + /// The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros. + /// + /// 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 OpenaiEmbeddingsAsync( + string model, + global::DeepInfra.AnyOf, string> input, + string? xDeepinfraSource = default, + string? userAgent = default, + string? xiApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat = default, + int? dimensions = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAIEmbeddingsIn + { + ServiceTier = serviceTier, + Model = model, + Input = input, + EncodingFormat = encodingFormat, + Dimensions = dimensions, + }; + + return await OpenaiEmbeddingsAsync( + xDeepinfraSource: xDeepinfraSource, + userAgent: userAgent, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.EmbeddingsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.EmbeddingsClient.g.cs new file mode 100644 index 00000000..37023c4a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.EmbeddingsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Generate text embeddings for search and RAG.
+ /// 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 EmbeddingsClient : global::DeepInfra.IEmbeddingsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the EmbeddingsClient. + /// 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 EmbeddingsClient( + 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 EmbeddingsClient 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 EmbeddingsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the EmbeddingsClient. + /// 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 EmbeddingsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.Exceptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Exceptions.g.cs index 7be0e5f7..b5c210c7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Exceptions.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Exceptions.g.cs @@ -12,16 +12,19 @@ public partial class ApiException : global::System.Exception /// The HTTP status code of the response. ///
public global::System.Net.HttpStatusCode StatusCode { get; } + /// /// The response body as a string, or null if the body could not be read. /// This is always populated for error responses regardless of the ReadResponseAsString setting. /// For success-path failures (e.g. deserialization errors), the client attempts a best-effort read. /// public string? ResponseBody { get; set; } + /// /// The response headers. /// public global::System.Collections.Generic.Dictionary>? ResponseHeaders { get; set; } + /// /// Initializes a new instance of the class. /// @@ -49,6 +52,103 @@ public ApiException(string message, global::System.Exception? innerException, gl { StatusCode = statusCode; } + + /// + /// Constructs an instance whose runtime type matches the response status code when the typed exception hierarchy is enabled. Always returns a plain when the hierarchy is disabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static global::DeepInfra.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::DeepInfra.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::DeepInfra.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::DeepInfra.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseHeaders = responseHeaders; + return exception; + } + + /// + /// Parses a Retry-After response header (delta-seconds or HTTP-date) into a . + /// Returns null when the header is missing or unparseable. Public so consumer code that observes + /// directly can recover the value without re-implementing the parser. + /// + public static global::System.TimeSpan? TryParseRetryAfter( + global::System.Collections.Generic.IDictionary>? headers) + { + if (headers == null) + { + return null; + } + + global::System.Collections.Generic.IEnumerable? values = null; + foreach (var entry in headers) + { + if (string.Equals(entry.Key, "Retry-After", global::System.StringComparison.OrdinalIgnoreCase)) + { + values = entry.Value; + break; + } + } + + if (values == null) + { + return null; + } + + string? raw = null; + foreach (var value in values) + { + if (!string.IsNullOrWhiteSpace(value)) + { + raw = value.Trim(); + break; + } + } + + if (string.IsNullOrEmpty(raw)) + { + return null; + } + + if (int.TryParse( + raw, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var seconds) && seconds >= 0) + { + return global::System.TimeSpan.FromSeconds(seconds); + } + + if (global::System.DateTimeOffset.TryParse( + raw, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var when)) + { + var delta = when - global::System.DateTimeOffset.UtcNow; + return delta > global::System.TimeSpan.Zero ? delta : global::System.TimeSpan.Zero; + } + + return null; + } } /// @@ -88,5 +188,39 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) { } + + /// + /// Constructs an whose runtime type matches the response status code when the typed exception hierarchy is enabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static new global::DeepInfra.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::DeepInfra.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::DeepInfra.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + T? responseObject, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::DeepInfra.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseObject = responseObject; + exception.ResponseHeaders = responseHeaders; + return exception; + } } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.CreateOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.CreateOpenaiBatch.g.cs new file mode 100644 index 00000000..6b096401 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.CreateOpenaiBatch.g.cs @@ -0,0 +1,529 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class FilesBatchesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateOpenaiBatchSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_CreateOpenaiBatchSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateOpenaiBatchSecurityRequirement0, + }; + partial void PrepareCreateOpenaiBatchArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.OpenAIBatchesIn request); + partial void PrepareCreateOpenaiBatchRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.OpenAIBatchesIn request); + partial void ProcessCreateOpenaiBatchResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateOpenaiBatchResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Openai Batch + /// + /// + /// + /// 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 CreateOpenaiBatchAsync( + + global::DeepInfra.OpenAIBatchesIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateOpenaiBatchAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Openai Batch + /// + /// + /// + /// 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> CreateOpenaiBatchAsResponseAsync( + + global::DeepInfra.OpenAIBatchesIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateOpenaiBatchArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateOpenaiBatchSecurityRequirements, + operationName: "CreateOpenaiBatchAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/batches", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateOpenaiBatchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOpenaiBatch", + methodName: "CreateOpenaiBatchAsync", + pathTemplate: "\"/v1/batches\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOpenaiBatch", + methodName: "CreateOpenaiBatchAsync", + pathTemplate: "\"/v1/batches\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOpenaiBatch", + methodName: "CreateOpenaiBatchAsync", + pathTemplate: "\"/v1/batches\"", + 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::DeepInfra.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); + ProcessCreateOpenaiBatchResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOpenaiBatch", + methodName: "CreateOpenaiBatchAsync", + pathTemplate: "\"/v1/batches\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateOpenaiBatch", + methodName: "CreateOpenaiBatchAsync", + pathTemplate: "\"/v1/batches\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessCreateOpenaiBatchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenAIBatch.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenAIBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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 Openai Batch + /// + /// + /// + /// The ID of an uploaded file that contains requests for the new batch. + /// + /// + /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. + /// + /// + /// The time frame within which the batch should be processed. Currently only 24h is supported. + /// + /// + /// Optional metadata to be stored with the batch. + /// + /// 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 CreateOpenaiBatchAsync( + string inputFileId, + global::DeepInfra.OpenAIBatchesInEndpoint endpoint, + string? xiApiKey = default, + string completionWindow = "24h", + object? metadata = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAIBatchesIn + { + InputFileId = inputFileId, + Endpoint = endpoint, + CompletionWindow = completionWindow, + Metadata = metadata, + }; + + return await CreateOpenaiBatchAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.ListFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.ListFiles.g.cs new file mode 100644 index 00000000..48f31423 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.ListFiles.g.cs @@ -0,0 +1,509 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class FilesBatchesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ListFilesSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ListFilesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ListFilesSecurityRequirement0, + }; + partial void PrepareListFilesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? after, + ref string? purpose, + ref string? order, + ref int? limit, + ref string? xiApiKey); + partial void PrepareListFilesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? after, + string? purpose, + string? order, + int? limit, + string? xiApiKey); + partial void ProcessListFilesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListFilesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Files + /// + /// + /// + /// + /// + /// Default Value: 100 + /// + /// + /// 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 ListFilesAsync( + string? after = default, + string? purpose = default, + string? order = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListFilesAsResponseAsync( + after: after, + purpose: purpose, + order: order, + limit: limit, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Files + /// + /// + /// + /// + /// + /// Default Value: 100 + /// + /// + /// 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> ListFilesAsResponseAsync( + string? after = default, + string? purpose = default, + string? order = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListFilesArguments( + httpClient: HttpClient, + after: ref after, + purpose: ref purpose, + order: ref order, + limit: ref limit, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListFilesSecurityRequirements, + operationName: "ListFilesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/files", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("after", after) + .AddOptionalParameter("purpose", purpose) + .AddOptionalParameter("order", order) + .AddOptionalParameter("limit", limit?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListFilesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + after: after, + purpose: purpose, + order: order, + limit: limit, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListFiles", + methodName: "ListFilesAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListFiles", + methodName: "ListFilesAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListFiles", + methodName: "ListFilesAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessListFilesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListFiles", + methodName: "ListFilesAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListFiles", + methodName: "ListFilesAsync", + pathTemplate: "\"/v1/files\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessListFilesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.OpenaiFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.OpenaiFiles.g.cs new file mode 100644 index 00000000..9118a564 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.OpenaiFiles.g.cs @@ -0,0 +1,1486 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class FilesBatchesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiFilesSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiFilesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiFilesSecurityRequirement0, + }; + partial void PrepareOpenaiFilesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.BodyOpenaiFilesV1FilesPost request); + partial void PrepareOpenaiFilesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.BodyOpenaiFilesV1FilesPost request); + partial void ProcessOpenaiFilesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiFilesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Files + /// + /// + /// + /// 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 OpenaiFilesAsync( + + global::DeepInfra.BodyOpenaiFilesV1FilesPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiFilesAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Files + /// + /// + /// + /// 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> OpenaiFilesAsResponseAsync( + + global::DeepInfra.BodyOpenaiFilesV1FilesPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenaiFilesArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiFilesSecurityRequirements, + operationName: "OpenaiFilesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/files", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Purpose ?? string.Empty), + name: "\"purpose\""); + + for (var __iFile = 0; __iFile < request.File.Count; __iFile++) + { + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File[__iFile]); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: $"\"file{__iFile}.bin\""); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiFilesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.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); + ProcessOpenaiFilesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiFilesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Files + /// + /// + /// + /// + /// 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 OpenaiFilesAsync( + string purpose, + global::System.Collections.Generic.IList file, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.BodyOpenaiFilesV1FilesPost + { + Purpose = purpose, + File = file, + }; + + return await OpenaiFilesAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Openai Files + /// + /// + /// + /// + /// The streams to send as multipart 'file' file parts. + /// + /// + /// Optional file names to use for the multipart 'file' file parts. + /// + /// 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 OpenaiFilesAsync( + string purpose, + global::System.Collections.Generic.IReadOnlyList file, + string? xiApiKey = default, + global::System.Collections.Generic.IReadOnlyList? fileFileNames = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::DeepInfra.BodyOpenaiFilesV1FilesPost + { + Purpose = purpose, + File = new global::System.Collections.Generic.List(), + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiFilesArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiFilesSecurityRequirements, + operationName: "OpenaiFilesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/files", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Purpose ?? string.Empty), + name: "\"purpose\""); + + for (var __iFile = 0; __iFile < file.Count; __iFile++) + { + var __fileNameFile = fileFileNames != null && + __iFile < fileFileNames.Count && + fileFileNames[__iFile] != null + ? fileFileNames[__iFile] + : $"file{__iFile}.bin"; + var __contentFile = new global::System.Net.Http.StreamContent(file[__iFile]); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFile is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFile) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: $"\"{__fileNameFile}\""); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiFilesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.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); + ProcessOpenaiFilesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiFilesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return __content; + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return __content; + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Files + /// + /// + /// + /// + /// The streams to send as multipart 'file' file parts. + /// + /// + /// Optional file names to use for the multipart 'file' file parts. + /// + /// 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> OpenaiFilesAsResponseAsync( + string purpose, + global::System.Collections.Generic.IReadOnlyList file, + string? xiApiKey = default, + global::System.Collections.Generic.IReadOnlyList? fileFileNames = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::DeepInfra.BodyOpenaiFilesV1FilesPost + { + Purpose = purpose, + File = new global::System.Collections.Generic.List(), + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiFilesArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiFilesSecurityRequirements, + operationName: "OpenaiFilesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/files", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Purpose ?? string.Empty), + name: "\"purpose\""); + + for (var __iFile = 0; __iFile < file.Count; __iFile++) + { + var __fileNameFile = fileFileNames != null && + __iFile < fileFileNames.Count && + fileFileNames[__iFile] != null + ? fileFileNames[__iFile] + : $"file{__iFile}.bin"; + var __contentFile = new global::System.Net.Http.StreamContent(file[__iFile]); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFile is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFile) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: $"\"{__fileNameFile}\""); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiFilesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.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); + ProcessOpenaiFilesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiFiles", + methodName: "OpenaiFilesAsync", + pathTemplate: "\"/v1/files\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiFilesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.RetrieveOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.RetrieveOpenaiBatch.g.cs new file mode 100644 index 00000000..e338dd51 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.RetrieveOpenaiBatch.g.cs @@ -0,0 +1,472 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class FilesBatchesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_RetrieveOpenaiBatchSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_RetrieveOpenaiBatchSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_RetrieveOpenaiBatchSecurityRequirement0, + }; + partial void PrepareRetrieveOpenaiBatchArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId, + ref string? xiApiKey); + partial void PrepareRetrieveOpenaiBatchRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId, + string? xiApiKey); + partial void ProcessRetrieveOpenaiBatchResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRetrieveOpenaiBatchResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Retrieve Openai Batch + /// + /// + /// + /// 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 RetrieveOpenaiBatchAsync( + string batchId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveOpenaiBatchAsResponseAsync( + batchId: batchId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Openai Batch + /// + /// + /// + /// 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> RetrieveOpenaiBatchAsResponseAsync( + string batchId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareRetrieveOpenaiBatchArguments( + httpClient: HttpClient, + batchId: ref batchId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RetrieveOpenaiBatchSecurityRequirements, + operationName: "RetrieveOpenaiBatchAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/batches/{batchId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRetrieveOpenaiBatchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RetrieveOpenaiBatch", + methodName: "RetrieveOpenaiBatchAsync", + pathTemplate: "$\"/v1/batches/{batchId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RetrieveOpenaiBatch", + methodName: "RetrieveOpenaiBatchAsync", + pathTemplate: "$\"/v1/batches/{batchId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RetrieveOpenaiBatch", + methodName: "RetrieveOpenaiBatchAsync", + pathTemplate: "$\"/v1/batches/{batchId}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessRetrieveOpenaiBatchResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RetrieveOpenaiBatch", + methodName: "RetrieveOpenaiBatchAsync", + pathTemplate: "$\"/v1/batches/{batchId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RetrieveOpenaiBatch", + methodName: "RetrieveOpenaiBatchAsync", + pathTemplate: "$\"/v1/batches/{batchId}\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessRetrieveOpenaiBatchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.RetrieveOpenaiBatches.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.RetrieveOpenaiBatches.g.cs new file mode 100644 index 00000000..00808039 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.RetrieveOpenaiBatches.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class FilesBatchesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_RetrieveOpenaiBatchesSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_RetrieveOpenaiBatchesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_RetrieveOpenaiBatchesSecurityRequirement0, + }; + partial void PrepareRetrieveOpenaiBatchesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string after, + ref int? limit, + ref string? xiApiKey); + partial void PrepareRetrieveOpenaiBatchesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string after, + int? limit, + string? xiApiKey); + partial void ProcessRetrieveOpenaiBatchesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRetrieveOpenaiBatchesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Retrieve Openai Batches + /// + /// + /// + /// Default Value: 20 + /// + /// + /// 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 RetrieveOpenaiBatchesAsync( + string after, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveOpenaiBatchesAsResponseAsync( + after: after, + limit: limit, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Openai Batches + /// + /// + /// + /// Default Value: 20 + /// + /// + /// 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> RetrieveOpenaiBatchesAsResponseAsync( + string after, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareRetrieveOpenaiBatchesArguments( + httpClient: HttpClient, + after: ref after, + limit: ref limit, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RetrieveOpenaiBatchesSecurityRequirements, + operationName: "RetrieveOpenaiBatchesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/batches", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("after", after) + .AddOptionalParameter("limit", limit?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRetrieveOpenaiBatchesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + after: after!, + limit: limit, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RetrieveOpenaiBatches", + methodName: "RetrieveOpenaiBatchesAsync", + pathTemplate: "\"/v1/batches\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RetrieveOpenaiBatches", + methodName: "RetrieveOpenaiBatchesAsync", + pathTemplate: "\"/v1/batches\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RetrieveOpenaiBatches", + methodName: "RetrieveOpenaiBatchesAsync", + pathTemplate: "\"/v1/batches\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessRetrieveOpenaiBatchesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RetrieveOpenaiBatches", + methodName: "RetrieveOpenaiBatchesAsync", + pathTemplate: "\"/v1/batches\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RetrieveOpenaiBatches", + methodName: "RetrieveOpenaiBatchesAsync", + pathTemplate: "\"/v1/batches\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessRetrieveOpenaiBatchesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.g.cs new file mode 100644 index 00000000..61898c0a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// File uploads and batch processing.
+ /// 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 FilesBatchesClient : global::DeepInfra.IFilesBatchesClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the FilesBatchesClient. + /// 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 FilesBatchesClient( + 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 FilesBatchesClient 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 FilesBatchesClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the FilesBatchesClient. + /// 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 FilesBatchesClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsDelete.g.cs new file mode 100644 index 00000000..9a787f92 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsDelete.g.cs @@ -0,0 +1,546 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class GpuRentalsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ContainerRentalsDeleteSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ContainerRentalsDeleteSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ContainerRentalsDeleteSecurityRequirement0, + }; + partial void PrepareContainerRentalsDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string containerId, + ref string? xiApiKey); + partial void PrepareContainerRentalsDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string containerId, + string? xiApiKey); + partial void ProcessContainerRentalsDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessContainerRentalsDeleteResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Container Rentals Delete + /// + /// + /// + /// 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 ContainerRentalsDeleteAsync( + string containerId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsDeleteAsResponseAsync( + containerId: containerId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Container Rentals Delete + /// + /// + /// + /// 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> ContainerRentalsDeleteAsResponseAsync( + string containerId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareContainerRentalsDeleteArguments( + httpClient: HttpClient, + containerId: ref containerId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ContainerRentalsDeleteSecurityRequirements, + operationName: "ContainerRentalsDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/containers/{containerId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareContainerRentalsDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + containerId: containerId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsDelete", + methodName: "ContainerRentalsDeleteAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsDelete", + methodName: "ContainerRentalsDeleteAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsDelete", + methodName: "ContainerRentalsDeleteAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "DELETE", + 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::DeepInfra.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); + ProcessContainerRentalsDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsDelete", + methodName: "ContainerRentalsDeleteAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsDelete", + methodName: "ContainerRentalsDeleteAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "DELETE", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessContainerRentalsDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsGet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsGet.g.cs new file mode 100644 index 00000000..0370c60a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsGet.g.cs @@ -0,0 +1,550 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class GpuRentalsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ContainerRentalsGetSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ContainerRentalsGetSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ContainerRentalsGetSecurityRequirement0, + }; + partial void PrepareContainerRentalsGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string containerId, + ref string? xiApiKey); + partial void PrepareContainerRentalsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string containerId, + string? xiApiKey); + partial void ProcessContainerRentalsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessContainerRentalsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Container Rentals Get + /// + /// + /// + /// 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 ContainerRentalsGetAsync( + string containerId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsGetAsResponseAsync( + containerId: containerId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Container Rentals Get + /// + /// + /// + /// 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> ContainerRentalsGetAsResponseAsync( + string containerId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareContainerRentalsGetArguments( + httpClient: HttpClient, + containerId: ref containerId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ContainerRentalsGetSecurityRequirements, + operationName: "ContainerRentalsGetAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/containers/{containerId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareContainerRentalsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + containerId: containerId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsGet", + methodName: "ContainerRentalsGetAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsGet", + methodName: "ContainerRentalsGetAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsGet", + methodName: "ContainerRentalsGetAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessContainerRentalsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsGet", + methodName: "ContainerRentalsGetAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsGet", + methodName: "ContainerRentalsGetAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "GET", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessContainerRentalsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ContainerRentalOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.ContainerRentalOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsGetParams.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsGetParams.g.cs new file mode 100644 index 00000000..af4c6f85 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsGetParams.g.cs @@ -0,0 +1,500 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class GpuRentalsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ContainerRentalsGetParamsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ContainerRentalsGetParamsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ContainerRentalsGetParamsSecurityRequirement0, + }; + partial void PrepareContainerRentalsGetParamsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareContainerRentalsGetParamsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessContainerRentalsGetParamsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessContainerRentalsGetParamsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Container Rentals Get Params + /// + /// + /// 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 ContainerRentalsGetParamsAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsGetParamsAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Container Rentals Get Params + /// + /// + /// 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> ContainerRentalsGetParamsAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareContainerRentalsGetParamsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ContainerRentalsGetParamsSecurityRequirements, + operationName: "ContainerRentalsGetParamsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/containers/params", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareContainerRentalsGetParamsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsGetParams", + methodName: "ContainerRentalsGetParamsAsync", + pathTemplate: "\"/v1/containers/params\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsGetParams", + methodName: "ContainerRentalsGetParamsAsync", + pathTemplate: "\"/v1/containers/params\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsGetParams", + methodName: "ContainerRentalsGetParamsAsync", + pathTemplate: "\"/v1/containers/params\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessContainerRentalsGetParamsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsGetParams", + methodName: "ContainerRentalsGetParamsAsync", + pathTemplate: "\"/v1/containers/params\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsGetParams", + methodName: "ContainerRentalsGetParamsAsync", + pathTemplate: "\"/v1/containers/params\"", + httpMethod: "GET", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessContainerRentalsGetParamsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsList.g.cs new file mode 100644 index 00000000..c797130b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsList.g.cs @@ -0,0 +1,559 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class GpuRentalsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ContainerRentalsListSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ContainerRentalsListSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ContainerRentalsListSecurityRequirement0, + }; + partial void PrepareContainerRentalsListArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::DeepInfra.ContainerRentalsListV1ContainersGetState? state, + ref string? xiApiKey); + partial void PrepareContainerRentalsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::DeepInfra.ContainerRentalsListV1ContainersGetState? state, + string? xiApiKey); + partial void ProcessContainerRentalsListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessContainerRentalsListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Container Rentals List + /// + /// + /// whether to return active or inactive containers
+ /// Default Value: active + /// + /// + /// 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> ContainerRentalsListAsync( + global::DeepInfra.ContainerRentalsListV1ContainersGetState? state = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsListAsResponseAsync( + state: state, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Container Rentals List + /// + /// + /// whether to return active or inactive containers
+ /// Default Value: active + /// + /// + /// 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>> ContainerRentalsListAsResponseAsync( + global::DeepInfra.ContainerRentalsListV1ContainersGetState? state = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareContainerRentalsListArguments( + httpClient: HttpClient, + state: ref state, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ContainerRentalsListSecurityRequirements, + operationName: "ContainerRentalsListAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/containers", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("state", state?.ToValueString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareContainerRentalsListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + state: state, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsList", + methodName: "ContainerRentalsListAsync", + pathTemplate: "\"/v1/containers\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsList", + methodName: "ContainerRentalsListAsync", + pathTemplate: "\"/v1/containers\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsList", + methodName: "ContainerRentalsListAsync", + pathTemplate: "\"/v1/containers\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessContainerRentalsListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsList", + methodName: "ContainerRentalsListAsync", + pathTemplate: "\"/v1/containers\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsList", + methodName: "ContainerRentalsListAsync", + pathTemplate: "\"/v1/containers\"", + httpMethod: "GET", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Unprocessable Entity + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.DeepError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessContainerRentalsListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsStart.g.cs new file mode 100644 index 00000000..fe1650f2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsStart.g.cs @@ -0,0 +1,640 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class GpuRentalsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ContainerRentalsStartSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ContainerRentalsStartSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ContainerRentalsStartSecurityRequirement0, + }; + partial void PrepareContainerRentalsStartArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.ContainerRentalStartIn request); + partial void PrepareContainerRentalsStartRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.ContainerRentalStartIn request); + partial void ProcessContainerRentalsStartResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessContainerRentalsStartResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Container Rentals Start + /// + /// + /// + /// 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 ContainerRentalsStartAsync( + + global::DeepInfra.ContainerRentalStartIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsStartAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Container Rentals Start + /// + /// + /// + /// 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> ContainerRentalsStartAsResponseAsync( + + global::DeepInfra.ContainerRentalStartIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareContainerRentalsStartArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ContainerRentalsStartSecurityRequirements, + operationName: "ContainerRentalsStartAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/containers", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareContainerRentalsStartRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsStart", + methodName: "ContainerRentalsStartAsync", + pathTemplate: "\"/v1/containers\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsStart", + methodName: "ContainerRentalsStartAsync", + pathTemplate: "\"/v1/containers\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsStart", + methodName: "ContainerRentalsStartAsync", + pathTemplate: "\"/v1/containers\"", + 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::DeepInfra.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); + ProcessContainerRentalsStartResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsStart", + methodName: "ContainerRentalsStartAsync", + pathTemplate: "\"/v1/containers\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsStart", + methodName: "ContainerRentalsStartAsync", + pathTemplate: "\"/v1/containers\"", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Unprocessable Entity + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.DeepError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too Many Requests + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::DeepInfra.DeepError? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::DeepInfra.DeepError.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::DeepInfra.DeepError.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::DeepInfra.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)); + } + + 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); + ProcessContainerRentalsStartResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ContainerRentalStartOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.ContainerRentalStartOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Container Rentals Start + /// + /// + /// + /// Container Name + /// + /// + /// GPU config + /// + /// + /// Container Image + /// + /// + /// Cloud Init User Data + /// + /// 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 ContainerRentalsStartAsync( + string name, + string gpuConfig, + string containerImage, + string cloudInitUserData, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ContainerRentalStartIn + { + Name = name, + GpuConfig = gpuConfig, + ContainerImage = containerImage, + CloudInitUserData = cloudInitUserData, + }; + + return await ContainerRentalsStartAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsUpdate.g.cs new file mode 100644 index 00000000..e2ce2c02 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsUpdate.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class GpuRentalsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ContainerRentalsUpdateSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ContainerRentalsUpdateSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ContainerRentalsUpdateSecurityRequirement0, + }; + partial void PrepareContainerRentalsUpdateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string containerId, + ref string? xiApiKey, + global::DeepInfra.ContainerRentalUpdateIn request); + partial void PrepareContainerRentalsUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string containerId, + string? xiApiKey, + global::DeepInfra.ContainerRentalUpdateIn request); + partial void ProcessContainerRentalsUpdateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessContainerRentalsUpdateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Container Rentals Update + /// + /// + /// + /// + /// 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 ContainerRentalsUpdateAsync( + string containerId, + + global::DeepInfra.ContainerRentalUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsUpdateAsResponseAsync( + containerId: containerId, + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Container Rentals Update + /// + /// + /// + /// + /// 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> ContainerRentalsUpdateAsResponseAsync( + string containerId, + + global::DeepInfra.ContainerRentalUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareContainerRentalsUpdateArguments( + httpClient: HttpClient, + containerId: ref containerId, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ContainerRentalsUpdateSecurityRequirements, + operationName: "ContainerRentalsUpdateAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/containers/{containerId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareContainerRentalsUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + containerId: containerId!, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsUpdate", + methodName: "ContainerRentalsUpdateAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsUpdate", + methodName: "ContainerRentalsUpdateAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsUpdate", + methodName: "ContainerRentalsUpdateAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "PATCH", + 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::DeepInfra.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); + ProcessContainerRentalsUpdateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsUpdate", + methodName: "ContainerRentalsUpdateAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ContainerRentalsUpdate", + methodName: "ContainerRentalsUpdateAsync", + pathTemplate: "$\"/v1/containers/{containerId}\"", + httpMethod: "PATCH", + 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); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unprocessable Entity + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.DeepError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessContainerRentalsUpdateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Container Rentals Update + /// + /// + /// + /// + /// Container Name + /// + /// 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 ContainerRentalsUpdateAsync( + string containerId, + string name, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ContainerRentalUpdateIn + { + Name = name, + }; + + return await ContainerRentalsUpdateAsync( + containerId: containerId, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.RentGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.RentGpuAvailability.g.cs new file mode 100644 index 00000000..841089d3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.RentGpuAvailability.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class GpuRentalsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_RentGpuAvailabilitySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_RentGpuAvailabilitySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_RentGpuAvailabilitySecurityRequirement0, + }; + partial void PrepareRentGpuAvailabilityArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? source, + ref string? baseModel, + ref string? xiApiKey); + partial void PrepareRentGpuAvailabilityRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? source, + string? baseModel, + string? xiApiKey); + partial void ProcessRentGpuAvailabilityResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRentGpuAvailabilityResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Rent Gpu Availability + /// + /// + /// + /// + /// 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 RentGpuAvailabilityAsync( + string? source = default, + string? baseModel = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RentGpuAvailabilityAsResponseAsync( + source: source, + baseModel: baseModel, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Rent Gpu Availability + /// + /// + /// + /// + /// 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> RentGpuAvailabilityAsResponseAsync( + string? source = default, + string? baseModel = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareRentGpuAvailabilityArguments( + httpClient: HttpClient, + source: ref source, + baseModel: ref baseModel, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RentGpuAvailabilitySecurityRequirements, + operationName: "RentGpuAvailabilityAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/containers/gpu_availability", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("source", source) + .AddOptionalParameter("base_model", baseModel) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRentGpuAvailabilityRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + source: source, + baseModel: baseModel, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RentGpuAvailability", + methodName: "RentGpuAvailabilityAsync", + pathTemplate: "\"/v1/containers/gpu_availability\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RentGpuAvailability", + methodName: "RentGpuAvailabilityAsync", + pathTemplate: "\"/v1/containers/gpu_availability\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RentGpuAvailability", + methodName: "RentGpuAvailabilityAsync", + pathTemplate: "\"/v1/containers/gpu_availability\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessRentGpuAvailabilityResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RentGpuAvailability", + methodName: "RentGpuAvailabilityAsync", + pathTemplate: "\"/v1/containers/gpu_availability\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RentGpuAvailability", + methodName: "RentGpuAvailabilityAsync", + pathTemplate: "\"/v1/containers/gpu_availability\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessRentGpuAvailabilityResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeployGPUAvailability.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeployGPUAvailability.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.g.cs new file mode 100644 index 00000000..e7fbf3b0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Rent dedicated GPU containers.
+ /// 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 GpuRentalsClient : global::DeepInfra.IGpuRentalsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the GpuRentalsClient. + /// 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 GpuRentalsClient( + 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 GpuRentalsClient 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 GpuRentalsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the GpuRentalsClient. + /// 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 GpuRentalsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.IAccountClient.AccountEmailValues.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountEmailValues.g.cs new file mode 100644 index 00000000..921e3691 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountEmailValues.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Account Email Values + /// + /// + /// 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 AccountEmailValuesAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Account Email Values + /// + /// + /// 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> AccountEmailValuesAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountGpuLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountGpuLimit.g.cs new file mode 100644 index 00000000..b836b226 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountGpuLimit.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Account Gpu Limit + /// + /// + /// 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 AccountGpuLimitAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Account Gpu Limit + /// + /// + /// 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> AccountGpuLimitAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountRateLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountRateLimit.g.cs new file mode 100644 index 00000000..1ffb67b4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountRateLimit.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Account Rate Limit + /// + /// + /// 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 AccountRateLimitAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Account Rate Limit + /// + /// + /// 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> AccountRateLimitAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountUpdateDetails.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountUpdateDetails.g.cs new file mode 100644 index 00000000..5e3730fd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountUpdateDetails.g.cs @@ -0,0 +1,99 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Account Update Details + /// + /// + /// + /// 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 AccountUpdateDetailsAsync( + + global::DeepInfra.MeIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Account Update Details + /// + /// + /// + /// 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> AccountUpdateDetailsAsResponseAsync( + + global::DeepInfra.MeIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Account Update Details + /// + /// + /// + /// Personal name + /// + /// + /// First name of the user + /// + /// + /// Last name of the user + /// + /// + /// Country of the user + /// + /// + /// + /// + /// Company name + /// + /// + /// Company website address + /// + /// + /// Job title of the user, e.g. 'Software Engineer' + /// + /// + /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. + /// + /// + /// Short description of the use case for the account + /// + /// + /// Short description of how the user found out about DeepInfra + /// + /// + /// Set to false to opt out of marketing emails + /// + /// + /// ISO 3166-1 alpha-2 country code of the user selected country + /// + /// 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 AccountUpdateDetailsAsync( + string? xiApiKey = default, + string? name = default, + string? firstName = default, + string? lastName = default, + string? country = default, + string? email = default, + bool? isBusinessAccount = default, + string? company = default, + string? website = default, + string? title = default, + string? displayName = default, + string? useCase = default, + string? attribution = default, + bool? marketingEmails = default, + string? countryCode = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.DeleteAccount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.DeleteAccount.g.cs new file mode 100644 index 00000000..0ab0e38d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.DeleteAccount.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Delete Account + /// + /// + /// 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 DeleteAccountAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Account + /// + /// + /// 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> DeleteAccountAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.Me.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.Me.g.cs new file mode 100644 index 00000000..5d4d6288 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.Me.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Me + /// + /// + /// Default Value: false + /// + /// + /// 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 MeAsync( + bool? checklist = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Me + /// + /// + /// Default Value: false + /// + /// + /// 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> MeAsResponseAsync( + bool? checklist = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestGpuLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestGpuLimitIncrease.g.cs new file mode 100644 index 00000000..904c1b56 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestGpuLimitIncrease.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// 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 RequestGpuLimitIncreaseAsync( + + global::DeepInfra.GpuLimitRequestIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// 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> RequestGpuLimitIncreaseAsResponseAsync( + + global::DeepInfra.GpuLimitRequestIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// + /// + /// 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 RequestGpuLimitIncreaseAsync( + string gpuType, + int requestedLimit, + string reason, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestRateLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestRateLimitIncrease.g.cs new file mode 100644 index 00000000..6dbe1884 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestRateLimitIncrease.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Request Rate Limit Increase + /// + /// + /// + /// 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 RequestRateLimitIncreaseAsync( + + global::DeepInfra.RateLimitRequestIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Request Rate Limit Increase + /// + /// + /// + /// 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> RequestRateLimitIncreaseAsResponseAsync( + + global::DeepInfra.RateLimitRequestIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Request Rate Limit Increase + /// + /// + /// + /// + /// + /// 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 RequestRateLimitIncreaseAsync( + int rateLimit, + string reason, + string? xiApiKey = default, + int? tpmRateLimit = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.TeamSetDisplayName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.TeamSetDisplayName.g.cs new file mode 100644 index 00000000..a5538bef --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.TeamSetDisplayName.g.cs @@ -0,0 +1,51 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Team Set Display Name + /// + /// + /// + /// 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 TeamSetDisplayNameAsync( + + global::DeepInfra.DisplayNameIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Team Set Display Name + /// + /// + /// + /// 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> TeamSetDisplayNameAsResponseAsync( + + global::DeepInfra.DisplayNameIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Team Set Display Name + /// + /// + /// + /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. + /// + /// 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 TeamSetDisplayNameAsync( + string displayName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.g.cs new file mode 100644 index 00000000..36217889 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// User profile, team management, and rate limits.
+ /// 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 IAccountClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCatalog.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCatalog.g.cs new file mode 100644 index 00000000..4600003c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCatalog.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Catalog + /// + /// + /// 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> OpenclawCatalogAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Catalog + /// + /// + /// 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>> OpenclawCatalogAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCreate.g.cs new file mode 100644 index 00000000..d63c20d0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCreate.g.cs @@ -0,0 +1,61 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Create + /// + /// + /// + /// 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 OpenclawCreateAsync( + + global::DeepInfra.OpenClawCreateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Create + /// + /// + /// + /// 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> OpenclawCreateAsResponseAsync( + + global::DeepInfra.OpenClawCreateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Create + /// + /// + /// + /// Instance name + /// + /// + /// Agent type identifier
+ /// Default Value: openclaw + /// + /// + /// Plan identifier
+ /// Default Value: standard + /// + /// 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 OpenclawCreateAsync( + string name, + string? xiApiKey = default, + string? agentTypeId = default, + string? planId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawDelete.g.cs new file mode 100644 index 00000000..0306591a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawDelete.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Delete + /// + /// + /// + /// 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 OpenclawDeleteAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Delete + /// + /// + /// + /// 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> OpenclawDeleteAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawGet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawGet.g.cs new file mode 100644 index 00000000..66cf4625 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawGet.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Get + /// + /// + /// + /// 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 OpenclawGetAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Get + /// + /// + /// + /// 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> OpenclawGetAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawLaunchToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawLaunchToken.g.cs new file mode 100644 index 00000000..c28cd301 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawLaunchToken.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Launch Token
+ /// Mint a single-use launch URL for the dashboard.
+ /// Called by the launcher page right when readyz flips ready. The launch URL
+ /// is used as a top-level navigation; /launch then sets the oc_auth cookie
+ /// and 302s into the proxied dashboard.
+ /// The user's bearer token is stashed in Redis under the token's jti and
+ /// retrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of
+ /// the URL and out of any signed payload while preserving the existing proxy
+ /// auth flow (oc_auth cookie value = bearer token).
+ /// Refuses instances whose agent_type has has_dashboard=False (e.g. hermes). + ///
+ /// + /// + /// 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 OpenclawLaunchTokenAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Launch Token
+ /// Mint a single-use launch URL for the dashboard.
+ /// Called by the launcher page right when readyz flips ready. The launch URL
+ /// is used as a top-level navigation; /launch then sets the oc_auth cookie
+ /// and 302s into the proxied dashboard.
+ /// The user's bearer token is stashed in Redis under the token's jti and
+ /// retrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of
+ /// the URL and out of any signed payload while preserving the existing proxy
+ /// auth flow (oc_auth cookie value = bearer token).
+ /// Refuses instances whose agent_type has has_dashboard=False (e.g. hermes). + ///
+ /// + /// + /// 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> OpenclawLaunchTokenAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawList.g.cs new file mode 100644 index 00000000..228b8e03 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawList.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw List + /// + /// + /// Which instances to return: active, inactive, or all (both)
+ /// Default Value: active + /// + /// + /// 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> OpenclawListAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw List + /// + /// + /// Which instances to return: active, inactive, or all (both)
+ /// Default Value: active + /// + /// + /// 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>> OpenclawListAsResponseAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawListBackups.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawListBackups.g.cs new file mode 100644 index 00000000..15e87a4e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawListBackups.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw List Backups + /// + /// + /// + /// 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> OpenclawListBackupsAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw List Backups + /// + /// + /// + /// 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>> OpenclawListBackupsAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawRestoreBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawRestoreBackup.g.cs new file mode 100644 index 00000000..9de52f7d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawRestoreBackup.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Restore Backup + /// + /// + /// + /// + /// 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 OpenclawRestoreBackupAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Restore Backup + /// + /// + /// + /// + /// 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> OpenclawRestoreBackupAsResponseAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawStart.g.cs new file mode 100644 index 00000000..b745e17e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawStart.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Start + /// + /// + /// + /// 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 OpenclawStartAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Start + /// + /// + /// + /// 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> OpenclawStartAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawStop.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawStop.g.cs new file mode 100644 index 00000000..813c175d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawStop.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Stop + /// + /// + /// + /// 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 OpenclawStopAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Stop + /// + /// + /// + /// 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> OpenclawStopAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawTriggerBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawTriggerBackup.g.cs new file mode 100644 index 00000000..3fe0115b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawTriggerBackup.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Trigger Backup + /// + /// + /// + /// 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 OpenclawTriggerBackupAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Trigger Backup + /// + /// + /// + /// 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> OpenclawTriggerBackupAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawUpdate.g.cs new file mode 100644 index 00000000..86e2309a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawUpdate.g.cs @@ -0,0 +1,57 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Update + /// + /// + /// + /// + /// 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 OpenclawUpdateAsync( + string instanceId, + + global::DeepInfra.OpenClawUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Update + /// + /// + /// + /// + /// 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> OpenclawUpdateAsResponseAsync( + string instanceId, + + global::DeepInfra.OpenClawUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Update + /// + /// + /// + /// + /// Instance name + /// + /// 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 OpenclawUpdateAsync( + string instanceId, + string name, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawUpdateVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawUpdateVersion.g.cs new file mode 100644 index 00000000..be754976 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawUpdateVersion.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Update Version + /// + /// + /// + /// 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 OpenclawUpdateVersionAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Update Version + /// + /// + /// + /// 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> OpenclawUpdateVersionAsResponseAsync( + string instanceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.g.cs new file mode 100644 index 00000000..c95317ac --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Manage agent-framework instances (OpenClaw and friends).
+ /// 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 IAgentsClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioSpeech.g.cs new file mode 100644 index 00000000..09cfa2a9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioSpeech.g.cs @@ -0,0 +1,83 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAudioClient + { + /// + /// Openai Audio Speech + /// + /// + /// + /// + /// 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 OpenaiAudioSpeechAsync( + + global::DeepInfra.OpenAITextToSpeechIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Audio Speech + /// + /// + /// + /// + /// 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> OpenaiAudioSpeechAsResponseAsync( + + global::DeepInfra.OpenAITextToSpeechIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Audio Speech + /// + /// + /// + /// + /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// model name + /// + /// + /// Text to convert to speech + /// + /// + /// Preset voices to use for the speech. + /// + /// + /// response format for the speech
+ /// Default Value: wav + /// + /// + /// speed of the speech
+ /// Default Value: 1F + /// + /// + /// Extra body parameters for the model. + /// + /// 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 OpenaiAudioSpeechAsync( + string model, + string input, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + string? voice = default, + global::DeepInfra.TtsResponseFormat? responseFormat = default, + double? speed = default, + object? extraBody = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranscriptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranscriptions.g.cs new file mode 100644 index 00000000..a3f4e876 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranscriptions.g.cs @@ -0,0 +1,144 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAudioClient + { + /// + /// Openai Audio Transcriptions + /// + /// + /// + /// + /// 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 OpenaiAudioTranscriptionsAsync( + + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Audio Transcriptions + /// + /// + /// + /// + /// 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> OpenaiAudioTranscriptionsAsResponseAsync( + + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Audio Transcriptions + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// + /// 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 OpenaiAudioTranscriptionsAsync( + byte[] file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Openai Audio Transcriptions + /// + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// + /// 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 OpenaiAudioTranscriptionsAsync( + global::System.IO.Stream file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Audio Transcriptions + /// + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// + /// 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> OpenaiAudioTranscriptionsAsResponseAsync( + global::System.IO.Stream file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranslations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranslations.g.cs new file mode 100644 index 00000000..9129def4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranslations.g.cs @@ -0,0 +1,132 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAudioClient + { + /// + /// Openai Audio Translations + /// + /// + /// + /// + /// 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 OpenaiAudioTranslationsAsync( + + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Audio Translations + /// + /// + /// + /// + /// 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> OpenaiAudioTranslationsAsResponseAsync( + + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Audio Translations + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// 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 OpenaiAudioTranslationsAsync( + byte[] file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Openai Audio Translations + /// + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// 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 OpenaiAudioTranslationsAsync( + global::System.IO.Stream file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Audio Translations + /// + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// + /// + /// Default Value: json + /// + /// + /// Default Value: 0 + /// + /// 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> OpenaiAudioTranslationsAsResponseAsync( + global::System.IO.Stream file, + string filename, + string model, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.g.cs new file mode 100644 index 00000000..5dd29774 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI-compatible speech synthesis, transcription, and translation.
+ /// 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 IAudioClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateApiToken.g.cs new file mode 100644 index 00000000..b85f6b34 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateApiToken.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Create Api Token + /// + /// + /// + /// 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 CreateApiTokenAsync( + + global::DeepInfra.ApiTokenIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Api Token + /// + /// + /// + /// 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> CreateApiTokenAsResponseAsync( + + global::DeepInfra.ApiTokenIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Api Token + /// + /// + /// + /// 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 CreateApiTokenAsync( + string name, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateScopedJwt.g.cs new file mode 100644 index 00000000..9cf4eae6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateScopedJwt.g.cs @@ -0,0 +1,65 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Create Scoped Jwt + /// + /// + /// + /// 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 CreateScopedJwtAsync( + + global::DeepInfra.ScopedJWTIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Scoped Jwt + /// + /// + /// + /// 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> CreateScopedJwtAsResponseAsync( + + global::DeepInfra.ScopedJWTIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Scoped Jwt + /// + /// + /// + /// + /// allow inference only to the specified model names + /// + /// + /// how many seconds in the future should the token be valid for + /// + /// + /// unix timestamp when the token should expire + /// + /// + /// only allow spending that much USD until the token becomes invalid + /// + /// 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 CreateScopedJwtAsync( + string apiKeyName, + string? xiApiKey = default, + global::System.Collections.Generic.IList? models = default, + int? expiresDelta = default, + int? expiresAt = default, + double? spendingLimit = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateSshKey.g.cs new file mode 100644 index 00000000..b5324063 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateSshKey.g.cs @@ -0,0 +1,55 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Create Ssh Key + /// + /// + /// + /// 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 CreateSshKeyAsync( + + global::DeepInfra.SshKeyIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Ssh Key + /// + /// + /// + /// 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> CreateSshKeyAsResponseAsync( + + global::DeepInfra.SshKeyIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Ssh Key + /// + /// + /// + /// SSH Key name + /// + /// + /// SSH Key content + /// + /// 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 CreateSshKeyAsync( + string name, + string key, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.DeleteApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.DeleteApiToken.g.cs new file mode 100644 index 00000000..a394828e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.DeleteApiToken.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Delete Api Token + /// + /// + /// + /// 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 DeleteApiTokenAsync( + string apiToken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Api Token + /// + /// + /// + /// 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> DeleteApiTokenAsResponseAsync( + string apiToken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.DeleteSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.DeleteSshKey.g.cs new file mode 100644 index 00000000..d6720d79 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.DeleteSshKey.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Delete Ssh Key + /// + /// + /// + /// 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 DeleteSshKeyAsync( + string sshKeyId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Ssh Key + /// + /// + /// + /// 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> DeleteSshKeyAsResponseAsync( + string sshKeyId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.ExportApiTokenToVercel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.ExportApiTokenToVercel.g.cs new file mode 100644 index 00000000..cd9fb6e1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.ExportApiTokenToVercel.g.cs @@ -0,0 +1,63 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Export Api Token To Vercel + /// + /// + /// + /// + /// 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 ExportApiTokenToVercelAsync( + string apiToken, + + global::DeepInfra.ApiTokenVercelExportIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Export Api Token To Vercel + /// + /// + /// + /// + /// 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> ExportApiTokenToVercelAsResponseAsync( + string apiToken, + + global::DeepInfra.ApiTokenVercelExportIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Export Api Token To Vercel + /// + /// + /// + /// + /// + /// + /// + /// + /// 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 ExportApiTokenToVercelAsync( + string apiToken, + string projectIdOrName, + bool isSensitive, + bool envDevelopment, + bool envPreview, + bool envProduction, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetApiToken.g.cs new file mode 100644 index 00000000..87885fbf --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetApiToken.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Get Api Token + /// + /// + /// + /// 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 GetApiTokenAsync( + string apiToken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Api Token + /// + /// + /// + /// 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> GetApiTokenAsResponseAsync( + string apiToken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetApiTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetApiTokens.g.cs new file mode 100644 index 00000000..83541ff1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetApiTokens.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Get Api Tokens + /// + /// + /// 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> GetApiTokensAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Api Tokens + /// + /// + /// 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>> GetApiTokensAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetSshKeys.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetSshKeys.g.cs new file mode 100644 index 00000000..738121f3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetSshKeys.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Get Ssh Keys + /// + /// + /// 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> GetSshKeysAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Ssh Keys + /// + /// + /// 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>> GetSshKeysAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GithubCliLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GithubCliLogin.g.cs new file mode 100644 index 00000000..8e96c9c9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GithubCliLogin.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Github Cli Login
+ /// deepctl is calling this request waiting for auth token during login.
+ /// The token is stored in /github/callback + ///
+ /// + /// 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 GithubCliLoginAsync( + string loginId, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Github Cli Login
+ /// deepctl is calling this request waiting for auth token during login.
+ /// The token is stored in /github/callback + ///
+ /// + /// 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> GithubCliLoginAsResponseAsync( + string loginId, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GithubLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GithubLogin.g.cs new file mode 100644 index 00000000..c8fb47d5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GithubLogin.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Github Login
+ /// Initiate github SSO login flow. Callback is /github/callback + ///
+ /// + /// + /// + /// + /// 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 GithubLoginAsync( + string? loginId = default, + string? origin = default, + string? deal = default, + string? tiToken = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Github Login
+ /// Initiate github SSO login flow. Callback is /github/callback + ///
+ /// + /// + /// + /// + /// 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> GithubLoginAsResponseAsync( + string? loginId = default, + string? origin = default, + string? deal = default, + string? tiToken = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.InspectScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.InspectScopedJwt.g.cs new file mode 100644 index 00000000..cb06d036 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.InspectScopedJwt.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Inspect Scoped Jwt + /// + /// + /// + /// 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 InspectScopedJwtAsync( + string jwtoken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inspect Scoped Jwt + /// + /// + /// + /// 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> InspectScopedJwtAsResponseAsync( + string jwtoken, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.OktaLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.OktaLogin.g.cs new file mode 100644 index 00000000..0849e118 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.OktaLogin.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Okta Login + /// + /// + /// + /// + /// 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 OktaLoginAsync( + string teamId, + string? origin = default, + string? loginId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Okta Login + /// + /// + /// + /// + /// 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> OktaLoginAsResponseAsync( + string teamId, + string? origin = default, + string? loginId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.g.cs new file mode 100644 index 00000000..d3335277 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// API tokens, SSH keys, scoped JWTs, and login flows.
+ /// 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 IAuthenticationClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.AddFunds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.AddFunds.g.cs new file mode 100644 index 00000000..4e8cd256 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.AddFunds.g.cs @@ -0,0 +1,63 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// 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 AddFundsAsync( + + global::DeepInfra.AddFundsIn request, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// 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> AddFundsAsResponseAsync( + + global::DeepInfra.AddFundsIn request, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// Amount to add in cents + /// + /// 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 AddFundsAsync( + int amount, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.BillingPortal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.BillingPortal.g.cs new file mode 100644 index 00000000..5f6c4989 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.BillingPortal.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Billing Portal + /// + /// + /// + /// 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 BillingPortalAsync( + string? returnUrl = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Billing Portal + /// + /// + /// + /// 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> BillingPortalAsResponseAsync( + string? returnUrl = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.DeepstartApply.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.DeepstartApply.g.cs new file mode 100644 index 00000000..dd0cca18 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.DeepstartApply.g.cs @@ -0,0 +1,69 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Deepstart Apply + /// + /// + /// + /// 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 DeepstartApplyAsync( + + global::DeepInfra.DeepStartApplicationIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deepstart Apply + /// + /// + /// + /// 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> DeepstartApplyAsResponseAsync( + + global::DeepInfra.DeepStartApplicationIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deepstart Apply + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: pending + /// + /// + /// 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 DeepstartApplyAsync( + string company, + string ceo, + string funding, + string foundedOn, + string website, + object? session = default, + string? id = default, + string? uid = default, + int? createdAt = default, + string? status = default, + string? deal = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetChecklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetChecklist.g.cs new file mode 100644 index 00000000..43b235e1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetChecklist.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Get Checklist + /// + /// + /// Default Value: false + /// + /// + /// 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 GetChecklistAsync( + bool? computeOwed = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Checklist + /// + /// + /// Default Value: false + /// + /// + /// 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> GetChecklistAsResponseAsync( + bool? computeOwed = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetConfig.g.cs new file mode 100644 index 00000000..c4fa3929 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetConfig.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Get Config + /// + /// + /// 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 GetConfigAsync( + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Config + /// + /// + /// 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> GetConfigAsResponseAsync( + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.ListInvoices.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.ListInvoices.g.cs new file mode 100644 index 00000000..90bb86ec --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.ListInvoices.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// List Invoices + /// + /// + /// Default Value: 10 + /// + /// + /// + /// + /// 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 ListInvoicesAsync( + int? limit = default, + string? startingAfter = default, + string? invoiceType = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Invoices + /// + /// + /// Default Value: 10 + /// + /// + /// + /// + /// 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> ListInvoicesAsResponseAsync( + int? limit = default, + string? startingAfter = default, + string? invoiceType = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetConfig.g.cs new file mode 100644 index 00000000..9d370a23 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetConfig.g.cs @@ -0,0 +1,51 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Set Config + /// + /// + /// + /// 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 SetConfigAsync( + + global::DeepInfra.ConfigIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Set Config + /// + /// + /// + /// 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> SetConfigAsResponseAsync( + + global::DeepInfra.ConfigIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Set Config + /// + /// + /// + /// Set usage limit (in USD). Negative means no limit.null/not-set means don't change it + /// + /// 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 SetConfigAsync( + object? session = default, + double? limit = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetupTopup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetupTopup.g.cs new file mode 100644 index 00000000..735b9765 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetupTopup.g.cs @@ -0,0 +1,62 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Setup Topup + /// + /// + /// + /// 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 SetupTopupAsync( + + global::DeepInfra.TopUpIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Setup Topup + /// + /// + /// + /// 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> SetupTopupAsResponseAsync( + + global::DeepInfra.TopUpIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Setup Topup + /// + /// + /// + /// Amount to top up in cents
+ /// Default Value: 0 + /// + /// + /// Top up threshold in cents, if balance goes below this value, top up will be triggered
+ /// Default Value: 0 + /// + /// + /// If true, top up will be triggered when balance goes below threshold
+ /// Default Value: true + /// + /// 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 SetupTopupAsync( + object? session = default, + int? amount = default, + int? threshold = default, + bool? enabled = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.Usage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.Usage.g.cs new file mode 100644 index 00000000..f734d548 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.Usage.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Usage + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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 UsageAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Usage + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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> UsageAsResponseAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageApiToken.g.cs new file mode 100644 index 00000000..e070a8fb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageApiToken.g.cs @@ -0,0 +1,50 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Usage Api Token + /// + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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 UsageApiTokenAsync( + string apiToken, + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Usage Api Token + /// + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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> UsageApiTokenAsResponseAsync( + string apiToken, + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageRent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageRent.g.cs new file mode 100644 index 00000000..43ac1273 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageRent.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Usage Rent + /// + /// + /// start of period, in seconds since unix epoch + /// + /// + /// end of period, in seconds since unix epoch + /// + /// + /// 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 UsageRentAsync( + int from, + int? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Usage Rent + /// + /// + /// start of period, in seconds since unix epoch + /// + /// + /// end of period, in seconds since unix epoch + /// + /// + /// 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> UsageRentAsResponseAsync( + int from, + int? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageTokens.g.cs new file mode 100644 index 00000000..d4868aa6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageTokens.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Usage Tokens + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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 UsageTokensAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Usage Tokens + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// 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> UsageTokensAsResponseAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.g.cs new file mode 100644 index 00000000..f8a1d2e1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Payment methods, usage tracking, and billing.
+ /// 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 IBillingClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessages.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessages.g.cs new file mode 100644 index 00000000..e1e51303 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessages.g.cs @@ -0,0 +1,95 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IChatCompletionsClient + { + /// + /// Anthropic Messages + /// + /// + /// + /// + /// + /// + /// 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 AnthropicMessagesAsync( + + global::DeepInfra.AnthropicMessagesIn request, + string? xApiKey = default, + string? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Anthropic Messages + /// + /// + /// + /// + /// + /// + /// 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> AnthropicMessagesAsResponseAsync( + + global::DeepInfra.AnthropicMessagesIn request, + string? xApiKey = default, + string? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Anthropic Messages + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: false + /// + /// + /// Default Value: 1F + /// + /// + /// + /// + /// + /// + /// + /// 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 AnthropicMessagesAsync( + string model, + global::System.Collections.Generic.IList messages, + string? xApiKey = default, + string? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + int? maxTokens = default, + global::DeepInfra.AnyOf, object>? system = default, + global::System.Collections.Generic.IList? stopSequences = default, + bool? stream = default, + double? temperature = default, + double? topP = default, + int? topK = default, + object? metadata = default, + global::System.Collections.Generic.IList? tools = default, + object? toolChoice = default, + global::DeepInfra.AnthropicThinkingConfig? thinking = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessagesCountTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessagesCountTokens.g.cs new file mode 100644 index 00000000..15be23b7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessagesCountTokens.g.cs @@ -0,0 +1,59 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IChatCompletionsClient + { + /// + /// Anthropic Messages Count Tokens + /// + /// + /// + /// 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 AnthropicMessagesCountTokensAsync( + + global::DeepInfra.AnthropicTokenCountRequest request, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Anthropic Messages Count Tokens + /// + /// + /// + /// 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> AnthropicMessagesCountTokensAsResponseAsync( + + global::DeepInfra.AnthropicTokenCountRequest request, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Anthropic Messages Count Tokens + /// + /// + /// + /// + /// + /// + /// + /// + /// 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 AnthropicMessagesCountTokensAsync( + string model, + global::System.Collections.Generic.IList messages, + string? xApiKey = default, + global::DeepInfra.AnyOf, object>? system = default, + global::System.Collections.Generic.IList? tools = default, + global::DeepInfra.AnthropicThinkingConfig? thinking = default, + object? toolChoice = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.OpenaiChatCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.OpenaiChatCompletions.g.cs new file mode 100644 index 00000000..554dbe2f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.OpenaiChatCompletions.g.cs @@ -0,0 +1,167 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IChatCompletionsClient + { + /// + /// Openai Chat Completions + /// + /// + /// + /// + /// 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 OpenaiChatCompletionsAsync( + + global::DeepInfra.OpenAIChatCompletionsIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Chat Completions + /// + /// + /// + /// + /// 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> OpenaiChatCompletionsAsResponseAsync( + + global::DeepInfra.OpenAIChatCompletionsIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Chat Completions + /// + /// + /// + /// + /// model name + /// + /// + /// conversation messages: (user,assistant,tool)*,user including one system message anywhere + /// + /// + /// whether to stream the output via SSE or return the full response
+ /// Default Value: false + /// + /// + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
+ /// Default Value: 1F + /// + /// + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
+ /// Default Value: 1F + /// + /// + /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
+ /// Default Value: 0F + /// + /// + /// Sample from the best k (number of) tokens. 0 means off
+ /// Default Value: 0 + /// + /// + /// The maximum number of tokens to generate in the chat completion.
+ /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. + /// + /// + /// up to 16 sequences where the API will stop generating further tokens + /// + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + /// + /// number of sequences to return
+ /// Default Value: 1 + /// + /// + /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// A list of tools the model may call. Currently, only functions are supported as a tool. + /// + /// + /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. + /// + /// + /// The format of the response. Currently, only json is supported. + /// + /// + /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
+ /// Default Value: 1 + /// + /// + /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. + /// + /// + /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. + /// + /// + /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. + /// + /// + /// streaming options + /// + /// + /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. + /// + /// + /// Reasoning configuration. + /// + /// + /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. + /// + /// + /// Chat template kwargs. + /// + /// + /// If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message. + /// + /// 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 OpenaiChatCompletionsAsync( + string model, + global::System.Collections.Generic.IList> messages, + string? xDeepinfraSource = default, + string? xiApiKey = default, + bool? stream = default, + double? temperature = default, + double? topP = default, + double? minP = default, + int? topK = default, + int? maxTokens = default, + global::DeepInfra.AnyOf, object>? stop = default, + global::System.Collections.Generic.IList? stopTokenIds = default, + int? n = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.IList? tools = default, + global::DeepInfra.AnyOf? toolChoice = default, + global::DeepInfra.AnyOf? responseFormat = default, + double? repetitionPenalty = default, + string? user = default, + int? seed = default, + bool? logprobs = default, + global::DeepInfra.StreamOptions? streamOptions = default, + global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, + global::DeepInfra.ChatReasoningSettings? reasoning = default, + string? promptCacheKey = default, + object? chatTemplateKwargs = default, + bool? continueFinalMessage = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.g.cs new file mode 100644 index 00000000..44e775ec --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI and Anthropic-compatible chat completion endpoints for LLMs.
+ /// 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 IChatCompletionsClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreate.g.cs new file mode 100644 index 00000000..7c230481 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreate.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Create + /// + /// + /// + /// 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 DeployCreateAsync( + + global::DeepInfra.DeployModelIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Create + /// + /// + /// + /// 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> DeployCreateAsResponseAsync( + + global::DeepInfra.DeployModelIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Create + /// + /// + /// + /// namespace for the model name
+ /// Default Value: cnt + /// + /// + /// model name in specified provider + /// + /// + /// A specific revision, if left empty uses the last one + /// + /// 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 DeployCreateAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.ModelProvider? provider = default, + string? version = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreateHf.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreateHf.g.cs new file mode 100644 index 00000000..70ee8ee8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreateHf.g.cs @@ -0,0 +1,55 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Create Hf + /// + /// + /// + /// 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 DeployCreateHfAsync( + + global::DeepInfra.HFModel request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Create Hf + /// + /// + /// + /// 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> DeployCreateHfAsResponseAsync( + + global::DeepInfra.HFModel request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Create Hf + /// + /// + /// + /// Model Id from huggingface + /// + /// + /// Task + /// + /// 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 DeployCreateHfAsync( + string modelName, + string? xiApiKey = default, + string? task = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreateLlm.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreateLlm.g.cs new file mode 100644 index 00000000..6690062b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreateLlm.g.cs @@ -0,0 +1,81 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Create Llm + /// + /// + /// + /// 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 DeployCreateLlmAsync( + + global::DeepInfra.DeployLLMIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Create Llm + /// + /// + /// + /// 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> DeployCreateLlmAsResponseAsync( + + global::DeepInfra.DeployLLMIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Create Llm + /// + /// + /// + /// model name for deepinfra (username/mode-name format) + /// + /// + /// The type of GPU the deployment is running on + /// + /// + /// Number of GPUs used by one instance
+ /// Default Value: 1 + /// + /// + /// Maximum number of concurrent requests
+ /// Default Value: 96 + /// + /// + /// + /// Base public model + /// + /// + /// Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4) + /// + /// + /// + /// Extra command line arguments for custom deployments + /// + /// 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 DeployCreateLlmAsync( + string modelName, + global::DeepInfra.DeployGPUs gpu, + string? xiApiKey = default, + int? numGpus = default, + int? maxBatchSize = default, + global::DeepInfra.HFWeights? hf = default, + string? baseModel = default, + string? containerImage = default, + global::DeepInfra.ScaleSettings? settings = default, + global::System.Collections.Generic.IList? extraArgs = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployDelete.g.cs new file mode 100644 index 00000000..a711a086 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployDelete.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Delete + /// + /// + /// + /// 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 DeployDeleteAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Delete + /// + /// + /// + /// 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> DeployDeleteAsResponseAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployDetailedStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployDetailedStats.g.cs new file mode 100644 index 00000000..6152347d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployDetailedStats.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Detailed Stats + /// + /// + /// + /// start of period, unix ts or 'now-5h', supported units s, m, h, d, w + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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 DeployDetailedStatsAsync( + string deployId, + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Detailed Stats + /// + /// + /// + /// start of period, unix ts or 'now-5h', supported units s, m, h, d, w + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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> DeployDetailedStatsAsResponseAsync( + string deployId, + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployGpuAvailability.g.cs new file mode 100644 index 00000000..db61c3fe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployGpuAvailability.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Gpu Availability + /// + /// + /// + /// + /// 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 DeployGpuAvailabilityAsync( + string? source = default, + string? baseModel = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Gpu Availability + /// + /// + /// + /// + /// 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> DeployGpuAvailabilityAsResponseAsync( + string? source = default, + string? baseModel = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployList2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployList2.g.cs new file mode 100644 index 00000000..49524df0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployList2.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy List + /// + /// + /// A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted + /// + /// + /// 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> DeployList2Async( + string? status = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy List + /// + /// + /// A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted + /// + /// + /// 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>> DeployList2AsResponseAsync( + string? status = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployLlmSuggestName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployLlmSuggestName.g.cs new file mode 100644 index 00000000..13360652 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployLlmSuggestName.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Llm Suggest Name + /// + /// + /// + /// 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 DeployLlmSuggestNameAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Llm Suggest Name + /// + /// + /// + /// 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> DeployLlmSuggestNameAsResponseAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStart.g.cs new file mode 100644 index 00000000..64865b0c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStart.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Start
+ /// Start a stopped deployment. Re-creates pods via auto-scaling. + ///
+ /// + /// + /// 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 DeployStartAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Start
+ /// Start a stopped deployment. Re-creates pods via auto-scaling. + ///
+ /// + /// + /// 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> DeployStartAsResponseAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStats.g.cs new file mode 100644 index 00000000..a268dea9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStats.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Stats + /// + /// + /// + /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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 DeployStatsAsync( + string deployId, + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Stats + /// + /// + /// + /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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> DeployStatsAsResponseAsync( + string deployId, + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStatus.g.cs new file mode 100644 index 00000000..ebea507b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStatus.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Status + /// + /// + /// + /// 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 DeployStatusAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Status + /// + /// + /// + /// 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> DeployStatusAsResponseAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStop.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStop.g.cs new file mode 100644 index 00000000..efdb5038 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStop.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Stop
+ /// Stop a running deployment. Terminates pods. Can be restarted later. + ///
+ /// + /// + /// 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 DeployStopAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Stop
+ /// Stop a running deployment. Terminates pods. Can be restarted later. + ///
+ /// + /// + /// 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> DeployStopAsResponseAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployUpdate.g.cs new file mode 100644 index 00000000..8968daab --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployUpdate.g.cs @@ -0,0 +1,55 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Update + /// + /// + /// + /// + /// 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 DeployUpdateAsync( + string deployId, + + global::DeepInfra.DeployLLMUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Update + /// + /// + /// + /// + /// 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> DeployUpdateAsResponseAsync( + string deployId, + + global::DeepInfra.DeployLLMUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Update + /// + /// + /// + /// + /// 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 DeployUpdateAsync( + string deployId, + global::DeepInfra.ScaleSettings settings, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeploymentStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeploymentStats.g.cs new file mode 100644 index 00000000..5c6fc672 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeploymentStats.g.cs @@ -0,0 +1,48 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deployment Stats + /// + /// + /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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> DeploymentStatsAsync( + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deployment Stats + /// + /// + /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) + /// + /// + /// end of period, unix ts or now-relative, check from, defaults to now
+ /// Default Value: now + /// + /// + /// 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>> DeploymentStatsAsResponseAsync( + string from, + string? to = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.g.cs new file mode 100644 index 00000000..acb0e30e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Deploy and manage private model instances with autoscaling.
+ /// 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 IDedicatedModelsClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountEmailValues.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountEmailValues.g.cs deleted file mode 100644 index e0e64566..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountEmailValues.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Account Email Values - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AccountEmailValuesAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountGpuLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountGpuLimit.g.cs deleted file mode 100644 index 60448a24..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountGpuLimit.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Account Gpu Limit - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AccountGpuLimitAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountRateLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountRateLimit.g.cs deleted file mode 100644 index a1808c7f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountRateLimit.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Account Rate Limit - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AccountRateLimitAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountUpdateDetails.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountUpdateDetails.g.cs deleted file mode 100644 index 6aa1c410..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountUpdateDetails.g.cs +++ /dev/null @@ -1,73 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Account Update Details - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AccountUpdateDetailsAsync( - - global::DeepInfra.MeIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Account Update Details - /// - /// - /// - /// Personal name - /// - /// - /// First name of the user - /// - /// - /// Last name of the user - /// - /// - /// Country of the user - /// - /// - /// - /// - /// Company name - /// - /// - /// Company website address - /// - /// - /// Job title of the user, e.g. 'Software Engineer' - /// - /// - /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. - /// - /// - /// Short description of the use case for the account - /// - /// - /// Short description of how the user found out about DeepInfra - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AccountUpdateDetailsAsync( - string? xiApiKey = default, - string? name = default, - string? firstName = default, - string? lastName = default, - string? country = default, - string? email = default, - bool? isBusinessAccount = default, - string? company = default, - string? website = default, - string? title = default, - string? displayName = default, - string? useCase = default, - string? attribution = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AddFunds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AddFunds.g.cs deleted file mode 100644 index 765b1215..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AddFunds.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Add Funds - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AddFundsAsync( - - global::DeepInfra.AddFundsIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Add Funds - /// - /// - /// - /// Amount to add in cents - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AddFundsAsync( - int amount, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessages.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessages.g.cs deleted file mode 100644 index 31dfada4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessages.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Anthropic Messages - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AnthropicMessagesAsync( - - global::DeepInfra.AnthropicMessagesIn request, - string? xApiKey = default, - string? anthropicVersion = default, - string? anthropicBeta = default, - string? xDeepinfraSource = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Anthropic Messages - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: false - /// - /// - /// Default Value: 1F - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AnthropicMessagesAsync( - string model, - global::System.Collections.Generic.IList messages, - string? xApiKey = default, - string? anthropicVersion = default, - string? anthropicBeta = default, - string? xDeepinfraSource = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? system = default, - global::System.Collections.Generic.IList? stopSequences = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - int? topK = default, - object? metadata = default, - global::System.Collections.Generic.IList? tools = default, - object? toolChoice = default, - global::DeepInfra.AnthropicThinkingConfig? thinking = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessagesCountTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessagesCountTokens.g.cs deleted file mode 100644 index 0c61a16d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessagesCountTokens.g.cs +++ /dev/null @@ -1,41 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Anthropic Messages Count Tokens - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AnthropicMessagesCountTokensAsync( - - global::DeepInfra.AnthropicTokenCountRequest request, - string? xApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Anthropic Messages Count Tokens - /// - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AnthropicMessagesCountTokensAsync( - string model, - global::System.Collections.Generic.IList messages, - string? xApiKey = default, - global::DeepInfra.AnyOf, object>? system = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnthropicThinkingConfig? thinking = default, - object? toolChoice = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Authorizations.Bearer.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Authorizations.Bearer.g.cs index 8723e29f..671e4325 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Authorizations.Bearer.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Authorizations.Bearer.g.cs @@ -9,6 +9,7 @@ public partial interface IDeepInfraClient /// Authorize using bearer authentication. /// /// + public void AuthorizeUsingBearer( string apiKey); } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.BillingPortal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.BillingPortal.g.cs deleted file mode 100644 index dfe3c5a3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.BillingPortal.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Billing Portal - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task BillingPortalAsync( - string? returnUrl = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CliVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CliVersion.g.cs deleted file mode 100644 index f9bde8c2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CliVersion.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Cli Version - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CliVersionAsync( - string version, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsDelete.g.cs deleted file mode 100644 index 6b2caa0c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsDelete.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals Delete - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsDeleteAsync( - string containerId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGet.g.cs deleted file mode 100644 index f0200fa1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGet.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals Get - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsGetAsync( - string containerId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGetParams.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGetParams.g.cs deleted file mode 100644 index 6a089385..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGetParams.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals Get Params - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsGetParamsAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsList.g.cs deleted file mode 100644 index c9029e32..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsList.g.cs +++ /dev/null @@ -1,22 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals List - /// - /// - /// whether to return active or inactive containers
- /// Default Value: active - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ContainerRentalsListAsync( - global::DeepInfra.ContainerRentalsListV1ContainersGetState? state = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsStart.g.cs deleted file mode 100644 index eb67a4d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsStart.g.cs +++ /dev/null @@ -1,45 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals Start - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsStartAsync( - - global::DeepInfra.ContainerRentalStartIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Container Rentals Start - /// - /// - /// - /// Container Name - /// - /// - /// GPU config - /// - /// - /// Container Image - /// - /// - /// Cloud Init User Data - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsStartAsync( - string name, - string gpuConfig, - string containerImage, - string cloudInitUserData, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsUpdate.g.cs deleted file mode 100644 index ed8fdb1b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsUpdate.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsUpdateAsync( - string containerId, - - global::DeepInfra.ContainerRentalUpdateIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Container Rentals Update - /// - /// - /// - /// - /// Container Name - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsUpdateAsync( - string containerId, - string name, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateApiToken.g.cs deleted file mode 100644 index 9f895d8e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateApiToken.g.cs +++ /dev/null @@ -1,31 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateApiTokenAsync( - - global::DeepInfra.ApiTokenIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateApiTokenAsync( - string name, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateLora.g.cs deleted file mode 100644 index a5bdb0ab..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateLora.g.cs +++ /dev/null @@ -1,39 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Lora - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateLoraAsync( - - global::DeepInfra.CreateLoraApiRequest request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Lora - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateLoraAsync( - string baseModel, - string loraName, - global::DeepInfra.SourceModel source, - bool @private, - string? xiApiKey = default, - string? description = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch.g.cs deleted file mode 100644 index 208f34cc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch.g.cs +++ /dev/null @@ -1,45 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateOpenaiBatchAsync( - - global::DeepInfra.OpenAIBatchesIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Openai Batch - /// - /// - /// - /// The ID of an uploaded file that contains requests for the new batch. - /// - /// - /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. - /// - /// - /// The time frame within which the batch should be processed. Currently only 24h is supported. - /// - /// - /// Optional metadata to be stored with the batch. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateOpenaiBatchAsync( - string inputFileId, - global::DeepInfra.OpenAIBatchesInEndpoint endpoint, - string? xiApiKey = default, - string completionWindow = "24h", - object? metadata = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch2.g.cs deleted file mode 100644 index 1246c5e1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch2.g.cs +++ /dev/null @@ -1,45 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateOpenaiBatch2Async( - - global::DeepInfra.OpenAIBatchesIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Openai Batch - /// - /// - /// - /// The ID of an uploaded file that contains requests for the new batch. - /// - /// - /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. - /// - /// - /// The time frame within which the batch should be processed. Currently only 24h is supported. - /// - /// - /// Optional metadata to be stored with the batch. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateOpenaiBatch2Async( - string inputFileId, - global::DeepInfra.OpenAIBatchesInEndpoint endpoint, - string? xiApiKey = default, - string completionWindow = "24h", - object? metadata = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateScopedJwt.g.cs deleted file mode 100644 index 2cc8e8e9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateScopedJwt.g.cs +++ /dev/null @@ -1,47 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Scoped Jwt - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateScopedJwtAsync( - - global::DeepInfra.ScopedJWTIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Scoped Jwt - /// - /// - /// - /// - /// allow inference only to the specified model names - /// - /// - /// how many seconds in the future should the token be valid for - /// - /// - /// unix timestamp when the token should expire - /// - /// - /// only allow spending that much USD until the token becomes invalid - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateScopedJwtAsync( - string apiKeyName, - string? xiApiKey = default, - global::System.Collections.Generic.IList? models = default, - int? expiresDelta = default, - int? expiresAt = default, - double? spendingLimit = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateSshKey.g.cs deleted file mode 100644 index fa2db53f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateSshKey.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Ssh Key - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateSshKeyAsync( - - global::DeepInfra.SshKeyIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Ssh Key - /// - /// - /// - /// SSH Key name - /// - /// - /// SSH Key content - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateSshKeyAsync( - string name, - string key, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateVoice.g.cs deleted file mode 100644 index 0b316c10..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateVoice.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Voice
- /// Create a new voice - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateVoiceAsync( - - global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Voice
- /// Create a new voice - ///
- /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateVoiceAsync( - string name, - string description, - global::System.Collections.Generic.IList files, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeepstartApply.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeepstartApply.g.cs deleted file mode 100644 index 56b327da..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeepstartApply.g.cs +++ /dev/null @@ -1,51 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deepstart Apply - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeepstartApplyAsync( - - global::DeepInfra.DeepStartApplicationIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deepstart Apply - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: pending - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeepstartApplyAsync( - string company, - string ceo, - string funding, - string foundedOn, - string website, - object? session = default, - string? id = default, - string? uid = default, - int? createdAt = default, - string? status = default, - string? deal = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteAccount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteAccount.g.cs deleted file mode 100644 index 8fc43fa5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteAccount.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Account - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteAccountAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteApiToken.g.cs deleted file mode 100644 index fefb0b5e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteApiToken.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteApiTokenAsync( - string apiToken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLora.g.cs deleted file mode 100644 index cdca8922..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLora.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Lora - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteLoraAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLoraModel.g.cs deleted file mode 100644 index a5167fc7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLoraModel.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Lora Model - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteLoraModelAsync( - string loraModelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteSshKey.g.cs deleted file mode 100644 index 6a8688fe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteSshKey.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Ssh Key - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteSshKeyAsync( - string sshKeyId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteVoice.g.cs deleted file mode 100644 index 340f75c4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteVoice.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Voice - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteVoiceAsync( - string voiceId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreate.g.cs deleted file mode 100644 index 9481fc5a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreate.g.cs +++ /dev/null @@ -1,42 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Create - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateAsync( - - global::DeepInfra.DeployModelIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deploy Create - /// - /// - /// - /// namespace for the model name
- /// Default Value: cnt - /// - /// - /// model name in specified provider - /// - /// - /// A specific revision, if left empty uses the last one - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateAsync( - string modelName, - string? xiApiKey = default, - global::DeepInfra.ModelProvider? provider = default, - string? version = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateHf.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateHf.g.cs deleted file mode 100644 index 05b2d33a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateHf.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Create Hf - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateHfAsync( - - global::DeepInfra.HFModel request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deploy Create Hf - /// - /// - /// - /// Model Id from huggingface - /// - /// - /// Task - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateHfAsync( - string modelName, - string? xiApiKey = default, - string? task = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateLlm.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateLlm.g.cs deleted file mode 100644 index 9fb25389..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateLlm.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Create Llm - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateLlmAsync( - - global::DeepInfra.DeployLLMIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deploy Create Llm - /// - /// - /// - /// model name for deepinfra (username/mode-name format) - /// - /// - /// The type of GPU the deployment is running on - /// - /// - /// Number of GPUs used by one instance
- /// Default Value: 1 - /// - /// - /// Maximum number of concurrent requests
- /// Default Value: 96 - /// - /// - /// - /// Base public model - /// - /// - /// Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4) - /// - /// - /// - /// Extra command line arguments for custom deployments - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateLlmAsync( - string modelName, - global::DeepInfra.DeployGPUs gpu, - string? xiApiKey = default, - int? numGpus = default, - int? maxBatchSize = default, - global::DeepInfra.HFWeights? hf = default, - string? baseModel = default, - string? containerImage = default, - global::DeepInfra.ScaleSettings? settings = default, - global::System.Collections.Generic.IList? extraArgs = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDelete.g.cs deleted file mode 100644 index 6d516dca..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDelete.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Delete - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployDeleteAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDetailedStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDetailedStats.g.cs deleted file mode 100644 index 8e485533..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDetailedStats.g.cs +++ /dev/null @@ -1,28 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Detailed Stats - /// - /// - /// - /// start of period, unix ts or 'now-5h', supported units s, m, h, d, w - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployDetailedStatsAsync( - string deployId, - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployGpuAvailability.g.cs deleted file mode 100644 index 5bcb9dc0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployGpuAvailability.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Gpu Availability - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployGpuAvailabilityAsync( - string? source = default, - string? baseModel = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployList2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployList2.g.cs deleted file mode 100644 index 208e51d1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployList2.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy List - /// - /// - /// A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> DeployList2Async( - string? status = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStart.g.cs deleted file mode 100644 index 3326b1b1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStart.g.cs +++ /dev/null @@ -1,20 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Start
- /// Start a stopped deployment. Re-creates pods via auto-scaling. - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployStartAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStats.g.cs deleted file mode 100644 index 8b5c9b0c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStats.g.cs +++ /dev/null @@ -1,28 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Stats - /// - /// - /// - /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployStatsAsync( - string deployId, - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStatus.g.cs deleted file mode 100644 index bb71473d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStatus.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Status - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployStatusAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStop.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStop.g.cs deleted file mode 100644 index eb2014ff..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStop.g.cs +++ /dev/null @@ -1,20 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Stop
- /// Stop a running deployment. Terminates pods. Can be restarted later. - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployStopAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployUpdate.g.cs deleted file mode 100644 index 7e922a5f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployUpdate.g.cs +++ /dev/null @@ -1,35 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployUpdateAsync( - string deployId, - - global::DeepInfra.DeployLLMUpdateIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deploy Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployUpdateAsync( - string deployId, - global::DeepInfra.ScaleSettings settings, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentLogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentLogsQuery.g.cs deleted file mode 100644 index e3b33b98..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentLogsQuery.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deployment Logs Query
- /// Query deployment logs.
- /// * Without timestamps (from/to) returns last `limit` messages (in last month).
- /// * With `from` only, returns first `limit` messages after `from` (inclusive).
- /// * With `to` only, returns last `limit` messages before `to` (inclusive).
- /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
- /// * `from` and `to` should be no more than a month apart. - ///
- /// - /// the deploy id to get the logs from - /// - /// - /// the pod name to get the logs from - /// - /// - /// start of period, in fractional seconds since unix epoch (inclusive) - /// - /// - /// end of period, in fractional seconds since unix epoch (exclusive) - /// - /// - /// how many items to return at most (default 100, in [1, 1000])
- /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeploymentLogsQueryAsync( - string deployId, - string? podName = default, - string? from = default, - string? to = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentStats.g.cs deleted file mode 100644 index 6bc5c5d8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentStats.g.cs +++ /dev/null @@ -1,26 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deployment Stats - /// - /// - /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> DeploymentStatsAsync( - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ExportApiTokenToVercel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ExportApiTokenToVercel.g.cs deleted file mode 100644 index 67f4eb8e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ExportApiTokenToVercel.g.cs +++ /dev/null @@ -1,43 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Export Api Token To Vercel - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ExportApiTokenToVercelAsync( - string apiToken, - - global::DeepInfra.ApiTokenVercelExportIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Export Api Token To Vercel - /// - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ExportApiTokenToVercelAsync( - string apiToken, - string projectIdOrName, - bool isSensitive, - bool envDevelopment, - bool envPreview, - bool envProduction, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiToken.g.cs deleted file mode 100644 index a4d5facd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiToken.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetApiTokenAsync( - string apiToken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiTokens.g.cs deleted file mode 100644 index d5f26978..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiTokens.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Api Tokens - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetApiTokensAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetChecklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetChecklist.g.cs deleted file mode 100644 index 0c7b2103..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetChecklist.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Checklist - /// - /// - /// Default Value: false - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetChecklistAsync( - bool? computeOwed = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetConfig.g.cs deleted file mode 100644 index a75d3a6e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetConfig.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Config - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetConfigAsync( - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetHardware.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetHardware.g.cs deleted file mode 100644 index d8abe592..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetHardware.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Hardware - /// - /// - /// Model name (NVIDIA NemoClaw format) - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetHardwareAsync( - string model, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLiveMetrics.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLiveMetrics.g.cs deleted file mode 100644 index 9a9df7b2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLiveMetrics.g.cs +++ /dev/null @@ -1,16 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Live Metrics
- /// Get the latest values for the Live metrics section on the web front page. - ///
- /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetLiveMetricsAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLora.g.cs deleted file mode 100644 index 079b0293..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLora.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Lora - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetLoraAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLoraStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLoraStatus.g.cs deleted file mode 100644 index 3e24b1cf..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLoraStatus.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Lora Status - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetLoraStatusAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetModelLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetModelLoras.g.cs deleted file mode 100644 index 18e2eac9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetModelLoras.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Model Loras - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetModelLorasAsync( - string modelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetRequestCosts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetRequestCosts.g.cs deleted file mode 100644 index e5f1ae58..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetRequestCosts.g.cs +++ /dev/null @@ -1,31 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Request Costs - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetRequestCostsAsync( - - global::DeepInfra.RequestCostQuery request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Get Request Costs - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetRequestCostsAsync( - global::System.Collections.Generic.IList requestIds, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetSshKeys.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetSshKeys.g.cs deleted file mode 100644 index adb520b4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetSshKeys.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Ssh Keys - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetSshKeysAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetUserLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetUserLoras.g.cs deleted file mode 100644 index 425abf8f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetUserLoras.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get User Loras - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetUserLorasAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoice.g.cs deleted file mode 100644 index 4991c835..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoice.g.cs +++ /dev/null @@ -1,20 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Voice
- /// Get a voice by its id - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetVoiceAsync( - string voiceId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoices.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoices.g.cs deleted file mode 100644 index b69275ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoices.g.cs +++ /dev/null @@ -1,18 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Voices
- /// Get available voices for a given user - ///
- /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetVoicesAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubCliLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubCliLogin.g.cs deleted file mode 100644 index efd3bda9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubCliLogin.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Github Cli Login
- /// deepctl is calling this request waiting for auth token during login.
- /// The token is stored in /github/callback - ///
- /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GithubCliLoginAsync( - string loginId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubLogin.g.cs deleted file mode 100644 index 961b7240..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubLogin.g.cs +++ /dev/null @@ -1,24 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Github Login
- /// Initiate github SSO login flow. Callback is /github/callback - ///
- /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GithubLoginAsync( - string? loginId = default, - string? origin = default, - string? deal = default, - string? tiToken = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceDeploy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceDeploy.g.cs deleted file mode 100644 index 65bf63d8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceDeploy.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Inference Deploy - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task InferenceDeployAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceModel.g.cs deleted file mode 100644 index f50e2976..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceModel.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Inference Model - /// - /// - /// - /// model version to run inference against - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task InferenceModelAsync( - string modelName, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InspectScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InspectScopedJwt.g.cs deleted file mode 100644 index 6e129584..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InspectScopedJwt.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Inspect Scoped Jwt - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task InspectScopedJwtAsync( - string jwtoken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles.g.cs deleted file mode 100644 index 5522e649..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles.g.cs +++ /dev/null @@ -1,27 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// List Files - /// - /// - /// - /// - /// - /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ListFilesAsync( - string? after = default, - string? purpose = default, - string? order = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles2.g.cs deleted file mode 100644 index 123b7e69..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles2.g.cs +++ /dev/null @@ -1,27 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// List Files - /// - /// - /// - /// - /// - /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ListFiles2Async( - string? after = default, - string? purpose = default, - string? order = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.LogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.LogsQuery.g.cs deleted file mode 100644 index 2575b3ab..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.LogsQuery.g.cs +++ /dev/null @@ -1,40 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Logs Query
- /// Query inference logs.
- /// * Without timestamps (from/to) returns last `limit` messages (in last month).
- /// * With `from` only, returns first `limit` messages after `from` (inclusive).
- /// * With `to` only, returns last `limit` messages before `to` (inclusive).
- /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
- /// * `from` and `to` should be no more than a month apart. - ///
- /// - /// the deploy id to get the logs from - /// - /// - /// start of period, in fractional seconds since unix epoch (inclusive) - /// - /// - /// end of period, in fractional seconds since unix epoch (exclusive) - /// - /// - /// how many items to return at most (default 100, in [1, 1000])
- /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task LogsQueryAsync( - string deployId, - string? from = default, - string? to = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Me.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Me.g.cs deleted file mode 100644 index bb1321ce..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Me.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Me - /// - /// - /// Default Value: false - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task MeAsync( - bool? checklist = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelDelete.g.cs deleted file mode 100644 index f1dd4069..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelDelete.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Delete - /// - /// - /// - /// delete a particular version, pass 'ALL' to wipe everything - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelDeleteAsync( - string modelName, - string version, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamiliesNames.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamiliesNames.g.cs deleted file mode 100644 index 824a2e2f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamiliesNames.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Families Names - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelFamiliesNamesAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamily.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamily.g.cs deleted file mode 100644 index ac5aaa35..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamily.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Family - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelFamilyAsync( - string familyName, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelMetaUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelMetaUpdate.g.cs deleted file mode 100644 index bfa90cf0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelMetaUpdate.g.cs +++ /dev/null @@ -1,61 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Meta Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelMetaUpdateAsync( - string modelName, - - global::DeepInfra.ModelMetaIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Model Meta Update - /// - /// - /// - /// - /// short model description in plain text - /// - /// - /// source code project link (empty to delete) - /// - /// - /// paper/research link (empty to delete) - /// - /// - /// usage license link (empty to delete) - /// - /// - /// markdown flavored model readme - /// - /// - /// dataurl or regular url to cover image (empty to delete) - /// - /// - /// model type - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelMetaUpdateAsync( - string modelName, - string? xiApiKey = default, - string? description = default, - string? githubUrl = default, - string? paperUrl = default, - string? licenseUrl = default, - string? readme = default, - string? coverImgUrl = default, - global::DeepInfra.HFTasksE? reportedType = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelPublicity.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelPublicity.g.cs deleted file mode 100644 index e018b85c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelPublicity.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Publicity - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelPublicityAsync( - string modelName, - - global::DeepInfra.ModelPublicityIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Model Publicity - /// - /// - /// - /// - /// whether to make the model public of private - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelPublicityAsync( - string modelName, - bool @public, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelSchema.g.cs deleted file mode 100644 index 22836ef5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelSchema.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Schema - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelSchemaAsync( - string modelName, - global::DeepInfra.SchemaVariantKey variantKey, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelVersions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelVersions.g.cs deleted file mode 100644 index b4f7a214..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelVersions.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Versions - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelVersionsAsync( - string modelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsDeploymentList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsDeploymentList.g.cs deleted file mode 100644 index dc1feb9e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsDeploymentList.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Models Deployment List - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelsDeploymentListAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsFeatured.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsFeatured.g.cs deleted file mode 100644 index 01f5dc4f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsFeatured.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Models Featured - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelsFeaturedAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsInfo.g.cs deleted file mode 100644 index b9dac807..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsInfo.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Models Info - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelsInfoAsync( - string modelName, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsList.g.cs deleted file mode 100644 index 5409051d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsList.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Models List - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelsListAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsLoraList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsLoraList.g.cs deleted file mode 100644 index 65ab29d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsLoraList.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Models Lora List - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelsLoraListAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OktaLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OktaLogin.g.cs deleted file mode 100644 index 362dd22a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OktaLogin.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Okta Login - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OktaLoginAsync( - string teamId, - string? origin = default, - string? loginId = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech.g.cs deleted file mode 100644 index 1ddf9f41..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioSpeechAsync( - - global::DeepInfra.OpenAITextToSpeechIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// Text to convert to speech - /// - /// - /// Preset voices to use for the speech. - /// - /// - /// response format for the speech
- /// Default Value: wav - /// - /// - /// speed of the speech
- /// Default Value: 1F - /// - /// - /// Extra body parameters for the model. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioSpeechAsync( - string model, - string input, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - string? voice = default, - global::DeepInfra.TtsResponseFormat? responseFormat = default, - double? speed = default, - object? extraBody = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech2.g.cs deleted file mode 100644 index 657d5d97..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech2.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioSpeech2Async( - - global::DeepInfra.OpenAITextToSpeechIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// Text to convert to speech - /// - /// - /// Preset voices to use for the speech. - /// - /// - /// response format for the speech
- /// Default Value: wav - /// - /// - /// speed of the speech
- /// Default Value: 1F - /// - /// - /// Extra body parameters for the model. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioSpeech2Async( - string model, - string input, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - string? voice = default, - global::DeepInfra.TtsResponseFormat? responseFormat = default, - double? speed = default, - object? extraBody = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions.g.cs deleted file mode 100644 index 63718d0c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranscriptionsAsync( - - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranscriptionsAsync( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? language = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Collections.Generic.IList? timestampGranularities = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions2.g.cs deleted file mode 100644 index 5428556e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions2.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranscriptions2Async( - - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranscriptions2Async( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? language = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Collections.Generic.IList? timestampGranularities = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations.g.cs deleted file mode 100644 index c4c5e60e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranslationsAsync( - - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranslationsAsync( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations2.g.cs deleted file mode 100644 index 4b00a5c3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations2.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranslations2Async( - - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranslations2Async( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions.g.cs deleted file mode 100644 index 3cc76883..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions.g.cs +++ /dev/null @@ -1,139 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiChatCompletionsAsync( - - global::DeepInfra.OpenAIChatCompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// model name - /// - /// - /// conversation messages: (user,assistant,tool)*,user including one system message anywhere - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// The maximum number of tokens to generate in the chat completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// A list of tools the model may call. Currently, only functions are supported as a tool. - /// - /// - /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. - /// - /// - /// streaming options - /// - /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. - /// - /// - /// Reasoning configuration. - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Chat template kwargs. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiChatCompletionsAsync( - string model, - global::System.Collections.Generic.IList> messages, - string? xDeepinfraSource = default, - string? xiApiKey = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? stop = default, - int? n = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnyOf? toolChoice = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - bool? logprobs = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, - global::DeepInfra.ChatReasoningSettings? reasoning = default, - string? promptCacheKey = default, - object? chatTemplateKwargs = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions2.g.cs deleted file mode 100644 index 6fddaa52..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions2.g.cs +++ /dev/null @@ -1,139 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiChatCompletions2Async( - - global::DeepInfra.OpenAIChatCompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// model name - /// - /// - /// conversation messages: (user,assistant,tool)*,user including one system message anywhere - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// The maximum number of tokens to generate in the chat completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// A list of tools the model may call. Currently, only functions are supported as a tool. - /// - /// - /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. - /// - /// - /// streaming options - /// - /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. - /// - /// - /// Reasoning configuration. - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Chat template kwargs. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiChatCompletions2Async( - string model, - global::System.Collections.Generic.IList> messages, - string? xDeepinfraSource = default, - string? xiApiKey = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? stop = default, - int? n = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnyOf? toolChoice = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - bool? logprobs = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, - global::DeepInfra.ChatReasoningSettings? reasoning = default, - string? promptCacheKey = default, - object? chatTemplateKwargs = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions.g.cs deleted file mode 100644 index 444fc88f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions.g.cs +++ /dev/null @@ -1,135 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiCompletionsAsync( - - global::DeepInfra.OpenAICompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Completions - /// - /// - /// - /// - /// model name - /// - /// - /// input prompt - a single string is currently supported - /// - /// - /// The maximum number of tokens to generate in the completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// return top tokens and their log-probabilities - /// - /// - /// return prompt as part of the respons - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// streaming options - /// - /// - /// List of token IDs that will stop generation when encountered - /// - /// - /// return tokens as token ids - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiCompletionsAsync( - string model, - global::DeepInfra.AnyOf> prompt, - string? xDeepinfraSource = default, - string? xiApiKey = default, - int? maxTokens = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? n = default, - bool? stream = default, - int? logprobs = default, - bool? echo = default, - global::DeepInfra.AnyOf, object>? stop = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::System.Collections.Generic.IList? stopTokenIds = default, - bool? returnTokensAsTokenIds = default, - string? promptCacheKey = default, - global::DeepInfra.CompletionMultiModalData? data = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions2.g.cs deleted file mode 100644 index 52cd0420..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions2.g.cs +++ /dev/null @@ -1,135 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiCompletions2Async( - - global::DeepInfra.OpenAICompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Completions - /// - /// - /// - /// - /// model name - /// - /// - /// input prompt - a single string is currently supported - /// - /// - /// The maximum number of tokens to generate in the completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// return top tokens and their log-probabilities - /// - /// - /// return prompt as part of the respons - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// streaming options - /// - /// - /// List of token IDs that will stop generation when encountered - /// - /// - /// return tokens as token ids - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiCompletions2Async( - string model, - global::DeepInfra.AnyOf> prompt, - string? xDeepinfraSource = default, - string? xiApiKey = default, - int? maxTokens = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? n = default, - bool? stream = default, - int? logprobs = default, - bool? echo = default, - global::DeepInfra.AnyOf, object>? stop = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::System.Collections.Generic.IList? stopTokenIds = default, - bool? returnTokensAsTokenIds = default, - string? promptCacheKey = default, - global::DeepInfra.CompletionMultiModalData? data = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings.g.cs deleted file mode 100644 index fd59a141..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings.g.cs +++ /dev/null @@ -1,58 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiEmbeddingsAsync( - - global::DeepInfra.OpenAIEmbeddingsIn request, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// sequences to embed - /// - /// - /// format used when encoding
- /// Default Value: float - /// - /// - /// The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiEmbeddingsAsync( - string model, - global::DeepInfra.AnyOf, string> input, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat = default, - int? dimensions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings2.g.cs deleted file mode 100644 index de1d0eef..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings2.g.cs +++ /dev/null @@ -1,58 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiEmbeddings2Async( - - global::DeepInfra.OpenAIEmbeddingsIn request, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// sequences to embed - /// - /// - /// format used when encoding
- /// Default Value: float - /// - /// - /// The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiEmbeddings2Async( - string model, - global::DeepInfra.AnyOf, string> input, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat = default, - int? dimensions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles.g.cs deleted file mode 100644 index 2afa2a4a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Files - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiFilesAsync( - - global::DeepInfra.BodyOpenaiFilesV1FilesPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Files - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiFilesAsync( - string purpose, - global::System.Collections.Generic.IList file, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles2.g.cs deleted file mode 100644 index 62c4535c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles2.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Files - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiFiles2Async( - - global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Files - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiFiles2Async( - string purpose, - global::System.Collections.Generic.IList file, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits.g.cs deleted file mode 100644 index 0da46fa9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits.g.cs +++ /dev/null @@ -1,41 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesEditsAsync( - - global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesEditsAsync( - byte[] image, - string imagename, - string prompt, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesEditsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits2.g.cs deleted file mode 100644 index 95dfd4fa..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits2.g.cs +++ /dev/null @@ -1,41 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesEdits2Async( - - global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesEdits2Async( - byte[] image, - string imagename, - string prompt, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesEditsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations.g.cs deleted file mode 100644 index 64859cc6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations.g.cs +++ /dev/null @@ -1,66 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesGenerationsAsync( - - global::DeepInfra.OpenAIImagesGenerationsIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The model to use for image generation. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The format in which the generated images are returned. Currently only b64_json is supported.
- /// Default Value: b64_json - /// - /// - /// The size of the generated images. Available sizes depend on the model.
- /// Default Value: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - /// - /// A text description of desired image(s). - /// - /// - /// The quality of the image that will be generated. - /// - /// - /// The style of the generated images. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesGenerationsAsync( - string model, - string prompt, - string? xiApiKey = default, - int? n = default, - global::DeepInfra.OpenAIImagesResponseFormat? responseFormat = default, - string? size = default, - string? user = default, - string? quality = default, - string? style = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations2.g.cs deleted file mode 100644 index 11bdf7c4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations2.g.cs +++ /dev/null @@ -1,66 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesGenerations2Async( - - global::DeepInfra.OpenAIImagesGenerationsIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The model to use for image generation. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The format in which the generated images are returned. Currently only b64_json is supported.
- /// Default Value: b64_json - /// - /// - /// The size of the generated images. Available sizes depend on the model.
- /// Default Value: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - /// - /// A text description of desired image(s). - /// - /// - /// The quality of the image that will be generated. - /// - /// - /// The style of the generated images. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesGenerations2Async( - string model, - string prompt, - string? xiApiKey = default, - int? n = default, - global::DeepInfra.OpenAIImagesResponseFormat? responseFormat = default, - string? size = default, - string? user = default, - string? quality = default, - string? style = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations.g.cs deleted file mode 100644 index 60d58f36..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations.g.cs +++ /dev/null @@ -1,39 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesVariationsAsync( - - global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesVariationsAsync( - byte[] image, - string imagename, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesVariationsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations2.g.cs deleted file mode 100644 index 55a16d5a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations2.g.cs +++ /dev/null @@ -1,39 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesVariations2Async( - - global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesVariations2Async( - byte[] image, - string imagename, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesVariationsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels.g.cs deleted file mode 100644 index 3b40f666..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Models - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiModelsAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels2.g.cs deleted file mode 100644 index 977c6484..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels2.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Models - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiModels2Async( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenrouterModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenrouterModels.g.cs deleted file mode 100644 index ba282d32..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenrouterModels.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openrouter Models - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenrouterModelsAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.PrivateModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.PrivateModelsList.g.cs deleted file mode 100644 index 94c17a1c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.PrivateModelsList.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Private Models List - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PrivateModelsListAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RentGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RentGpuAvailability.g.cs deleted file mode 100644 index e7d204fc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RentGpuAvailability.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Rent Gpu Availability - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RentGpuAvailabilityAsync( - string? source = default, - string? baseModel = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestGpuLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestGpuLimitIncrease.g.cs deleted file mode 100644 index 76d1d625..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestGpuLimitIncrease.g.cs +++ /dev/null @@ -1,35 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Request Gpu Limit Increase - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( - - global::DeepInfra.GpuLimitRequestIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Request Gpu Limit Increase - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( - string gpuType, - int requestedLimit, - string reason, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestRateLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestRateLimitIncrease.g.cs deleted file mode 100644 index d873d65b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestRateLimitIncrease.g.cs +++ /dev/null @@ -1,35 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Request Rate Limit Increase - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RequestRateLimitIncreaseAsync( - - global::DeepInfra.RateLimitRequestIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Request Rate Limit Increase - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RequestRateLimitIncreaseAsync( - int rateLimit, - string reason, - string? xiApiKey = default, - int? tpmRateLimit = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch.g.cs deleted file mode 100644 index cfaa5955..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Retrieve Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RetrieveOpenaiBatchAsync( - string batchId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch2.g.cs deleted file mode 100644 index 28976379..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch2.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Retrieve Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RetrieveOpenaiBatch2Async( - string batchId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches.g.cs deleted file mode 100644 index 123004b7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Retrieve Openai Batches - /// - /// - /// - /// Default Value: 20 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RetrieveOpenaiBatchesAsync( - string after, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches2.g.cs deleted file mode 100644 index 4509e69b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches2.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Retrieve Openai Batches - /// - /// - /// - /// Default Value: 20 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RetrieveOpenaiBatches2Async( - string after, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetConfig.g.cs deleted file mode 100644 index 9f6e6736..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetConfig.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Set Config - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SetConfigAsync( - - global::DeepInfra.ConfigIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Set Config - /// - /// - /// - /// Set usage limit (in USD). Negative means no limit.null/not-set means don't change it - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SetConfigAsync( - object? session = default, - double? limit = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetupTopup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetupTopup.g.cs deleted file mode 100644 index 0aa024e0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetupTopup.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Setup Topup - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SetupTopupAsync( - - global::DeepInfra.TopUpIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Setup Topup - /// - /// - /// - /// Amount to top up in cents
- /// Default Value: 0 - /// - /// - /// Top up threshold in cents, if balance goes below this value, top up will be triggered
- /// Default Value: 0 - /// - /// - /// If true, top up will be triggered when balance goes below threshold
- /// Default Value: true - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SetupTopupAsync( - object? session = default, - int? amount = default, - int? threshold = default, - bool? enabled = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SubmitFeedback.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SubmitFeedback.g.cs deleted file mode 100644 index 0035475e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SubmitFeedback.g.cs +++ /dev/null @@ -1,39 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Submit Feedback
- /// Submit feedback - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SubmitFeedbackAsync( - - global::DeepInfra.FeedbackIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Submit Feedback
- /// Submit feedback - ///
- /// - /// - /// The message you'd like to send to deepinfra team - /// - /// - /// Optional contact email to reach you back - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SubmitFeedbackAsync( - string message, - string? xiApiKey = default, - string? contactEmail = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TeamSetDisplayName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TeamSetDisplayName.g.cs deleted file mode 100644 index c1b22e7e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TeamSetDisplayName.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Team Set Display Name - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TeamSetDisplayNameAsync( - - global::DeepInfra.DisplayNameIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Team Set Display Name - /// - /// - /// - /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TeamSetDisplayNameAsync( - string displayName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeech.g.cs deleted file mode 100644 index b29adca0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeech.g.cs +++ /dev/null @@ -1,55 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Text To Speech - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TextToSpeechAsync( - string voiceId, - - global::DeepInfra.ElevenLabsTextToSpeechIn request, - string? outputFormat = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text To Speech - /// - /// - /// - /// - /// - /// Text to convert to speech - /// - /// - /// Model ID to use for the conversion
- /// Default Value: hexgrad/Kokoro-82M - /// - /// - /// Output format for the speech
- /// Default Value: wav - /// - /// - /// ISO 639-1, 2 letter language code - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TextToSpeechAsync( - string voiceId, - string text, - string? outputFormat = default, - string? xiApiKey = default, - string? modelId = default, - global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, - string? languageCode = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeechStream.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeechStream.g.cs deleted file mode 100644 index 9ee8131a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeechStream.g.cs +++ /dev/null @@ -1,55 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Text To Speech Stream - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TextToSpeechStreamAsync( - string voiceId, - - global::DeepInfra.ElevenLabsTextToSpeechIn request, - string? outputFormat = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text To Speech Stream - /// - /// - /// - /// - /// - /// Text to convert to speech - /// - /// - /// Model ID to use for the conversion
- /// Default Value: hexgrad/Kokoro-82M - /// - /// - /// Output format for the speech
- /// Default Value: wav - /// - /// - /// ISO 639-1, 2 letter language code - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TextToSpeechStreamAsync( - string voiceId, - string text, - string? outputFormat = default, - string? xiApiKey = default, - string? modelId = default, - global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, - string? languageCode = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateLora.g.cs deleted file mode 100644 index b91d8312..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateLora.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Update Lora - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateLoraAsync( - string loraName, - - global::DeepInfra.UpdateLoraApiRequest request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Update Lora - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateLoraAsync( - string loraName, - string? xiApiKey = default, - bool? @private = default, - string? description = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateVoice.g.cs deleted file mode 100644 index 9254ec66..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateVoice.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Update Voice - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateVoiceAsync( - string voiceId, - - global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Update Voice - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateVoiceAsync( - string voiceId, - string name, - string description, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UploadLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UploadLoraModel.g.cs deleted file mode 100644 index ca16b646..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UploadLoraModel.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Upload Lora Model - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UploadLoraModelAsync( - - global::DeepInfra.LoraModelUploadIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upload Lora Model - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UploadLoraModelAsync( - string hfModelName, - string loraModelName, - string? xiApiKey = default, - string? hfToken = default, - string? baseModelName = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Usage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Usage.g.cs deleted file mode 100644 index 493ef7e8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Usage.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Usage - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UsageAsync( - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageApiToken.g.cs deleted file mode 100644 index bafb060a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageApiToken.g.cs +++ /dev/null @@ -1,27 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Usage Api Token - /// - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UsageApiTokenAsync( - string apiToken, - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageRent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageRent.g.cs deleted file mode 100644 index 689409e1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageRent.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Usage Rent - /// - /// - /// start of period, in seconds since unix epoch - /// - /// - /// end of period, in seconds since unix epoch - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UsageRentAsync( - int from, - int? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageTokens.g.cs deleted file mode 100644 index dbeafab3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageTokens.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Usage Tokens - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UsageTokensAsync( - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.g.cs index 3b6c9ecc..710ae9eb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.g.cs @@ -4,6 +4,7 @@ namespace DeepInfra { /// + /// The DeepInfra API provides serverless AI inference, custom model deployments, and GPU rentals.
/// 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. ///
@@ -32,6 +33,11 @@ public partial interface IDeepInfraClient : global::System.IDisposable /// ensuring is populated. /// public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// /// @@ -39,5 +45,95 @@ public partial interface IDeepInfraClient : global::System.IDisposable global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + /// + /// User profile, team management, and rate limits. + /// + public AccountClient Account { get; } + + /// + /// Manage agent-framework instances (OpenClaw and friends). + /// + public AgentsClient Agents { get; } + + /// + /// OpenAI-compatible speech synthesis, transcription, and translation. + /// + public AudioClient Audio { get; } + + /// + /// API tokens, SSH keys, scoped JWTs, and login flows. + /// + public AuthenticationClient Authentication { get; } + + /// + /// Payment methods, usage tracking, and billing. + /// + public BillingClient Billing { get; } + + /// + /// OpenAI and Anthropic-compatible chat completion endpoints for LLMs. + /// + public ChatCompletionsClient ChatCompletions { get; } + + /// + /// Deploy and manage private model instances with autoscaling. + /// + public DedicatedModelsClient DedicatedModels { get; } + + /// + /// Generate text embeddings for search and RAG. + /// + public EmbeddingsClient Embeddings { get; } + + /// + /// File uploads and batch processing. + /// + public FilesBatchesClient FilesBatches { get; } + + /// + /// Rent dedicated GPU containers. + /// + public GpuRentalsClient GpuRentals { get; } + + /// + /// Generate, edit, and create variations of images. + /// + public ImageGenerationClient ImageGeneration { get; } + + /// + /// Native DeepInfra inference API for models and deployments. + /// + public InferenceClient Inference { get; } + + /// + /// Create, manage, and query LoRA adapter models. + /// + public LoRAAdaptersClient LoRAAdapters { get; } + + /// + /// Query inference logs, deployment logs, and usage metrics. + /// + public LogsMetricsClient LogsMetrics { get; } + + /// + /// Browse, search, and manage AI models. + /// + public ModelsClient Models { get; } + + /// + /// OpenAI-compatible text completion endpoints. + /// + public TextCompletionsClient TextCompletions { get; } + + /// + /// ElevenLabs-compatible TTS endpoints and voice management. + /// + public TextToSpeechClient TextToSpeech { get; } + + /// + /// Feedback submission and CLI version. + /// + public UtilitiesClient Utilities { get; } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IEmbeddingsClient.OpenaiEmbeddings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IEmbeddingsClient.OpenaiEmbeddings.g.cs new file mode 100644 index 00000000..b215f155 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IEmbeddingsClient.OpenaiEmbeddings.g.cs @@ -0,0 +1,80 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IEmbeddingsClient + { + /// + /// Openai Embeddings + /// + /// + /// + /// + /// + /// 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 OpenaiEmbeddingsAsync( + + global::DeepInfra.OpenAIEmbeddingsIn request, + string? xDeepinfraSource = default, + string? userAgent = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Embeddings + /// + /// + /// + /// + /// + /// 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> OpenaiEmbeddingsAsResponseAsync( + + global::DeepInfra.OpenAIEmbeddingsIn request, + string? xDeepinfraSource = default, + string? userAgent = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Embeddings + /// + /// + /// + /// + /// + /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// model name + /// + /// + /// sequences to embed + /// + /// + /// format used when encoding
+ /// Default Value: float + /// + /// + /// The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros. + /// + /// 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 OpenaiEmbeddingsAsync( + string model, + global::DeepInfra.AnyOf, string> input, + string? xDeepinfraSource = default, + string? userAgent = default, + string? xiApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat = default, + int? dimensions = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IEmbeddingsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IEmbeddingsClient.g.cs new file mode 100644 index 00000000..5b039878 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IEmbeddingsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Generate text embeddings for search and RAG.
+ /// 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 IEmbeddingsClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.CreateOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.CreateOpenaiBatch.g.cs new file mode 100644 index 00000000..928e3536 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.CreateOpenaiBatch.g.cs @@ -0,0 +1,63 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IFilesBatchesClient + { + /// + /// Create Openai Batch + /// + /// + /// + /// 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 CreateOpenaiBatchAsync( + + global::DeepInfra.OpenAIBatchesIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Openai Batch + /// + /// + /// + /// 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> CreateOpenaiBatchAsResponseAsync( + + global::DeepInfra.OpenAIBatchesIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Openai Batch + /// + /// + /// + /// The ID of an uploaded file that contains requests for the new batch. + /// + /// + /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. + /// + /// + /// The time frame within which the batch should be processed. Currently only 24h is supported. + /// + /// + /// Optional metadata to be stored with the batch. + /// + /// 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 CreateOpenaiBatchAsync( + string inputFileId, + global::DeepInfra.OpenAIBatchesInEndpoint endpoint, + string? xiApiKey = default, + string completionWindow = "24h", + object? metadata = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.ListFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.ListFiles.g.cs new file mode 100644 index 00000000..7d34b950 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.ListFiles.g.cs @@ -0,0 +1,50 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IFilesBatchesClient + { + /// + /// List Files + /// + /// + /// + /// + /// + /// Default Value: 100 + /// + /// + /// 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 ListFilesAsync( + string? after = default, + string? purpose = default, + string? order = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Files + /// + /// + /// + /// + /// + /// Default Value: 100 + /// + /// + /// 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> ListFilesAsResponseAsync( + string? after = default, + string? purpose = default, + string? order = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.OpenaiFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.OpenaiFiles.g.cs new file mode 100644 index 00000000..cfd57f9e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.OpenaiFiles.g.cs @@ -0,0 +1,94 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IFilesBatchesClient + { + /// + /// Openai Files + /// + /// + /// + /// 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 OpenaiFilesAsync( + + global::DeepInfra.BodyOpenaiFilesV1FilesPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Files + /// + /// + /// + /// 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> OpenaiFilesAsResponseAsync( + + global::DeepInfra.BodyOpenaiFilesV1FilesPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Files + /// + /// + /// + /// + /// 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 OpenaiFilesAsync( + string purpose, + global::System.Collections.Generic.IList file, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Openai Files + /// + /// + /// + /// + /// The streams to send as multipart 'file' file parts. + /// + /// + /// Optional file names to use for the multipart 'file' file parts. + /// + /// 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 OpenaiFilesAsync( + string purpose, + global::System.Collections.Generic.IReadOnlyList file, + string? xiApiKey = default, + global::System.Collections.Generic.IReadOnlyList? fileFileNames = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Files + /// + /// + /// + /// + /// The streams to send as multipart 'file' file parts. + /// + /// + /// Optional file names to use for the multipart 'file' file parts. + /// + /// 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> OpenaiFilesAsResponseAsync( + string purpose, + global::System.Collections.Generic.IReadOnlyList file, + string? xiApiKey = default, + global::System.Collections.Generic.IReadOnlyList? fileFileNames = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.RetrieveOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.RetrieveOpenaiBatch.g.cs new file mode 100644 index 00000000..4f3ddc57 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.RetrieveOpenaiBatch.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IFilesBatchesClient + { + /// + /// Retrieve Openai Batch + /// + /// + /// + /// 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 RetrieveOpenaiBatchAsync( + string batchId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Openai Batch + /// + /// + /// + /// 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> RetrieveOpenaiBatchAsResponseAsync( + string batchId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.RetrieveOpenaiBatches.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.RetrieveOpenaiBatches.g.cs new file mode 100644 index 00000000..d64135fd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.RetrieveOpenaiBatches.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IFilesBatchesClient + { + /// + /// Retrieve Openai Batches + /// + /// + /// + /// Default Value: 20 + /// + /// + /// 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 RetrieveOpenaiBatchesAsync( + string after, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Openai Batches + /// + /// + /// + /// Default Value: 20 + /// + /// + /// 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> RetrieveOpenaiBatchesAsResponseAsync( + string after, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.g.cs new file mode 100644 index 00000000..cc57a888 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// File uploads and batch processing.
+ /// 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 IFilesBatchesClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsDelete.g.cs new file mode 100644 index 00000000..e96d8391 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsDelete.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IGpuRentalsClient + { + /// + /// Container Rentals Delete + /// + /// + /// + /// 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 ContainerRentalsDeleteAsync( + string containerId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Container Rentals Delete + /// + /// + /// + /// 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> ContainerRentalsDeleteAsResponseAsync( + string containerId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsGet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsGet.g.cs new file mode 100644 index 00000000..f0b204b3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsGet.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IGpuRentalsClient + { + /// + /// Container Rentals Get + /// + /// + /// + /// 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 ContainerRentalsGetAsync( + string containerId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Container Rentals Get + /// + /// + /// + /// 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> ContainerRentalsGetAsResponseAsync( + string containerId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsGetParams.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsGetParams.g.cs new file mode 100644 index 00000000..d6b815b9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsGetParams.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IGpuRentalsClient + { + /// + /// Container Rentals Get Params + /// + /// + /// 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 ContainerRentalsGetParamsAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Container Rentals Get Params + /// + /// + /// 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> ContainerRentalsGetParamsAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsList.g.cs new file mode 100644 index 00000000..81da8c49 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsList.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IGpuRentalsClient + { + /// + /// Container Rentals List + /// + /// + /// whether to return active or inactive containers
+ /// Default Value: active + /// + /// + /// 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> ContainerRentalsListAsync( + global::DeepInfra.ContainerRentalsListV1ContainersGetState? state = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Container Rentals List + /// + /// + /// whether to return active or inactive containers
+ /// Default Value: active + /// + /// + /// 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>> ContainerRentalsListAsResponseAsync( + global::DeepInfra.ContainerRentalsListV1ContainersGetState? state = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsStart.g.cs new file mode 100644 index 00000000..00bc3426 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsStart.g.cs @@ -0,0 +1,63 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IGpuRentalsClient + { + /// + /// Container Rentals Start + /// + /// + /// + /// 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 ContainerRentalsStartAsync( + + global::DeepInfra.ContainerRentalStartIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Container Rentals Start + /// + /// + /// + /// 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> ContainerRentalsStartAsResponseAsync( + + global::DeepInfra.ContainerRentalStartIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Container Rentals Start + /// + /// + /// + /// Container Name + /// + /// + /// GPU config + /// + /// + /// Container Image + /// + /// + /// Cloud Init User Data + /// + /// 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 ContainerRentalsStartAsync( + string name, + string gpuConfig, + string containerImage, + string cloudInitUserData, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsUpdate.g.cs new file mode 100644 index 00000000..4b0ecb14 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsUpdate.g.cs @@ -0,0 +1,57 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IGpuRentalsClient + { + /// + /// Container Rentals Update + /// + /// + /// + /// + /// 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 ContainerRentalsUpdateAsync( + string containerId, + + global::DeepInfra.ContainerRentalUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Container Rentals Update + /// + /// + /// + /// + /// 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> ContainerRentalsUpdateAsResponseAsync( + string containerId, + + global::DeepInfra.ContainerRentalUpdateIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Container Rentals Update + /// + /// + /// + /// + /// Container Name + /// + /// 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 ContainerRentalsUpdateAsync( + string containerId, + string name, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.RentGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.RentGpuAvailability.g.cs new file mode 100644 index 00000000..f47a627e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.RentGpuAvailability.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IGpuRentalsClient + { + /// + /// Rent Gpu Availability + /// + /// + /// + /// + /// 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 RentGpuAvailabilityAsync( + string? source = default, + string? baseModel = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Rent Gpu Availability + /// + /// + /// + /// + /// 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> RentGpuAvailabilityAsResponseAsync( + string? source = default, + string? baseModel = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.g.cs new file mode 100644 index 00000000..a1959120 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Rent dedicated GPU containers.
+ /// 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 IGpuRentalsClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesEdits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesEdits.g.cs new file mode 100644 index 00000000..2afbf710 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesEdits.g.cs @@ -0,0 +1,109 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IImageGenerationClient + { + /// + /// Openai Images Edits
+ /// Edit image using OpenAI Images Edits API + ///
+ /// + /// + /// 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 OpenaiImagesEditsAsync( + + global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Images Edits
+ /// Edit image using OpenAI Images Edits API + ///
+ /// + /// + /// 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> OpenaiImagesEditsAsResponseAsync( + + global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Images Edits
+ /// Edit image using OpenAI Images Edits API + ///
+ /// + /// + /// + /// + /// + /// + /// 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 OpenaiImagesEditsAsync( + byte[] image, + string imagename, + string prompt, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesEditsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Openai Images Edits
+ /// Edit image using OpenAI Images Edits API + ///
+ /// + /// + /// The stream to send as the multipart 'image' file part. + /// + /// + /// + /// + /// + /// 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 OpenaiImagesEditsAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesEditsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Images Edits
+ /// Edit image using OpenAI Images Edits API + ///
+ /// + /// + /// The stream to send as the multipart 'image' file part. + /// + /// + /// + /// + /// + /// 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> OpenaiImagesEditsAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesEditsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesGenerations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesGenerations.g.cs new file mode 100644 index 00000000..89c3ef90 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesGenerations.g.cs @@ -0,0 +1,85 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IImageGenerationClient + { + /// + /// Openai Images Generations
+ /// Generate image using OpenAI Images API + ///
+ /// + /// + /// 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 OpenaiImagesGenerationsAsync( + + global::DeepInfra.OpenAIImagesGenerationsIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Images Generations
+ /// Generate image using OpenAI Images API + ///
+ /// + /// + /// 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> OpenaiImagesGenerationsAsResponseAsync( + + global::DeepInfra.OpenAIImagesGenerationsIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Images Generations
+ /// Generate image using OpenAI Images API + ///
+ /// + /// + /// The model to use for image generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The format in which the generated images are returned. Currently only b64_json is supported.
+ /// Default Value: b64_json + /// + /// + /// The size of the generated images. Available sizes depend on the model.
+ /// Default Value: 1024x1024 + /// + /// + /// A unique identifier representing your end-user, which can help to monitor and detect abuse. + /// + /// + /// A text description of desired image(s). + /// + /// + /// The quality of the image that will be generated. + /// + /// + /// The style of the generated images. + /// + /// 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 OpenaiImagesGenerationsAsync( + string model, + string prompt, + string? xiApiKey = default, + int? n = default, + global::DeepInfra.OpenAIImagesResponseFormat? responseFormat = default, + string? size = default, + string? user = default, + string? quality = default, + string? style = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesVariations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesVariations.g.cs new file mode 100644 index 00000000..f3c97446 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesVariations.g.cs @@ -0,0 +1,103 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IImageGenerationClient + { + /// + /// Openai Images Variations
+ /// Generate a similar image using OpenAI Images Variations API + ///
+ /// + /// + /// 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 OpenaiImagesVariationsAsync( + + global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Images Variations
+ /// Generate a similar image using OpenAI Images Variations API + ///
+ /// + /// + /// 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> OpenaiImagesVariationsAsResponseAsync( + + global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Images Variations
+ /// Generate a similar image using OpenAI Images Variations API + ///
+ /// + /// + /// + /// + /// + /// 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 OpenaiImagesVariationsAsync( + byte[] image, + string imagename, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesVariationsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Openai Images Variations
+ /// Generate a similar image using OpenAI Images Variations API + ///
+ /// + /// + /// The stream to send as the multipart 'image' file part. + /// + /// + /// + /// + /// 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 OpenaiImagesVariationsAsync( + global::System.IO.Stream image, + string imagename, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesVariationsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Images Variations
+ /// Generate a similar image using OpenAI Images Variations API + ///
+ /// + /// + /// The stream to send as the multipart 'image' file part. + /// + /// + /// + /// + /// 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> OpenaiImagesVariationsAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesVariationsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.g.cs new file mode 100644 index 00000000..32f31f95 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Generate, edit, and create variations of images.
+ /// 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 IImageGenerationClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.InferenceDeploy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.InferenceDeploy.g.cs new file mode 100644 index 00000000..85904929 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.InferenceDeploy.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IInferenceClient + { + /// + /// Inference Deploy + /// + /// + /// + /// 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 InferenceDeployAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inference Deploy + /// + /// + /// + /// 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> InferenceDeployAsResponseAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.InferenceModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.InferenceModel.g.cs new file mode 100644 index 00000000..c76f5128 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.InferenceModel.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IInferenceClient + { + /// + /// Inference Model + /// + /// + /// + /// model version to run inference against + /// + /// + /// 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 InferenceModelAsync( + string modelName, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Inference Model + /// + /// + /// + /// model version to run inference against + /// + /// + /// 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> InferenceModelAsResponseAsync( + string modelName, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.g.cs new file mode 100644 index 00000000..eff112b4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Native DeepInfra inference API for models and deployments.
+ /// 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 IInferenceClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.CreateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.CreateLora.g.cs new file mode 100644 index 00000000..59509415 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.CreateLora.g.cs @@ -0,0 +1,57 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILoRAAdaptersClient + { + /// + /// Create Lora + /// + /// + /// + /// 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 CreateLoraAsync( + + global::DeepInfra.CreateLoraApiRequest request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Lora + /// + /// + /// + /// 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> CreateLoraAsResponseAsync( + + global::DeepInfra.CreateLoraApiRequest request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Lora + /// + /// + /// + /// + /// + /// + /// + /// 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 CreateLoraAsync( + string baseModel, + string loraName, + global::DeepInfra.SourceModel source, + bool @private, + string? xiApiKey = default, + string? description = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.DeleteLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.DeleteLora.g.cs new file mode 100644 index 00000000..abbf8ca0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.DeleteLora.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILoRAAdaptersClient + { + /// + /// Delete Lora + /// + /// + /// + /// 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 DeleteLoraAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Lora + /// + /// + /// + /// 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> DeleteLoraAsResponseAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.DeleteLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.DeleteLoraModel.g.cs new file mode 100644 index 00000000..a9c81199 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.DeleteLoraModel.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILoRAAdaptersClient + { + /// + /// Delete Lora Model + /// + /// + /// + /// 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 DeleteLoraModelAsync( + string loraModelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Lora Model + /// + /// + /// + /// 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> DeleteLoraModelAsResponseAsync( + string loraModelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetLora.g.cs new file mode 100644 index 00000000..08b7efc1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetLora.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILoRAAdaptersClient + { + /// + /// Get Lora + /// + /// + /// + /// 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 GetLoraAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Lora + /// + /// + /// + /// 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> GetLoraAsResponseAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetLoraStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetLoraStatus.g.cs new file mode 100644 index 00000000..b3580d1f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetLoraStatus.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILoRAAdaptersClient + { + /// + /// Get Lora Status + /// + /// + /// + /// 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 GetLoraStatusAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Lora Status + /// + /// + /// + /// 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> GetLoraStatusAsResponseAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetModelLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetModelLoras.g.cs new file mode 100644 index 00000000..b6bf1978 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetModelLoras.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILoRAAdaptersClient + { + /// + /// Get Model Loras + /// + /// + /// + /// 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 GetModelLorasAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Model Loras + /// + /// + /// + /// 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> GetModelLorasAsResponseAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetUserLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetUserLoras.g.cs new file mode 100644 index 00000000..ab62690b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetUserLoras.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILoRAAdaptersClient + { + /// + /// Get User Loras + /// + /// + /// 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 GetUserLorasAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get User Loras + /// + /// + /// 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> GetUserLorasAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.UpdateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.UpdateLora.g.cs new file mode 100644 index 00000000..46eb665d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.UpdateLora.g.cs @@ -0,0 +1,57 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILoRAAdaptersClient + { + /// + /// Update Lora + /// + /// + /// + /// + /// 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 UpdateLoraAsync( + string loraName, + + global::DeepInfra.UpdateLoraApiRequest request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Lora + /// + /// + /// + /// + /// 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> UpdateLoraAsResponseAsync( + string loraName, + + global::DeepInfra.UpdateLoraApiRequest request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Lora + /// + /// + /// + /// + /// + /// 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 UpdateLoraAsync( + string loraName, + string? xiApiKey = default, + bool? @private = default, + string? description = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.UploadLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.UploadLoraModel.g.cs new file mode 100644 index 00000000..11417273 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.UploadLoraModel.g.cs @@ -0,0 +1,55 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILoRAAdaptersClient + { + /// + /// Upload Lora Model + /// + /// + /// + /// 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 UploadLoraModelAsync( + + global::DeepInfra.LoraModelUploadIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload Lora Model + /// + /// + /// + /// 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> UploadLoraModelAsResponseAsync( + + global::DeepInfra.LoraModelUploadIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload Lora Model + /// + /// + /// + /// + /// + /// + /// 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 UploadLoraModelAsync( + string hfModelName, + string loraModelName, + string? xiApiKey = default, + string? hfToken = default, + string? baseModelName = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.g.cs new file mode 100644 index 00000000..a5583433 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Create, manage, and query LoRA adapter models.
+ /// 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 ILoRAAdaptersClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.DeploymentLogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.DeploymentLogsQuery.g.cs new file mode 100644 index 00000000..905f388a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.DeploymentLogsQuery.g.cs @@ -0,0 +1,84 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILogsMetricsClient + { + /// + /// Deployment Logs Query
+ /// Query deployment logs.
+ /// * Without timestamps (from/to) returns last `limit` messages (in last month).
+ /// * With `from` only, returns first `limit` messages after `from` (inclusive).
+ /// * With `to` only, returns last `limit` messages before `to` (inclusive).
+ /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
+ /// * `from` and `to` should be no more than a month apart. + ///
+ /// + /// the deploy id to get the logs from + /// + /// + /// the pod name to get the logs from + /// + /// + /// start of period, in fractional seconds since unix epoch (inclusive) + /// + /// + /// end of period, in fractional seconds since unix epoch (exclusive) + /// + /// + /// how many items to return at most (default 100, in [1, 1000])
+ /// Default Value: 100 + /// + /// + /// 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 DeploymentLogsQueryAsync( + string deployId, + string? podName = default, + string? from = default, + string? to = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deployment Logs Query
+ /// Query deployment logs.
+ /// * Without timestamps (from/to) returns last `limit` messages (in last month).
+ /// * With `from` only, returns first `limit` messages after `from` (inclusive).
+ /// * With `to` only, returns last `limit` messages before `to` (inclusive).
+ /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
+ /// * `from` and `to` should be no more than a month apart. + ///
+ /// + /// the deploy id to get the logs from + /// + /// + /// the pod name to get the logs from + /// + /// + /// start of period, in fractional seconds since unix epoch (inclusive) + /// + /// + /// end of period, in fractional seconds since unix epoch (exclusive) + /// + /// + /// how many items to return at most (default 100, in [1, 1000])
+ /// Default Value: 100 + /// + /// + /// 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> DeploymentLogsQueryAsResponseAsync( + string deployId, + string? podName = default, + string? from = default, + string? to = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.GetLiveMetrics.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.GetLiveMetrics.g.cs new file mode 100644 index 00000000..9fae8f10 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.GetLiveMetrics.g.cs @@ -0,0 +1,28 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILogsMetricsClient + { + /// + /// Get Live Metrics
+ /// Get the latest values for the Live metrics section on the web front page. + ///
+ /// 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 GetLiveMetricsAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Live Metrics
+ /// Get the latest values for the Live metrics section on the web front page. + ///
+ /// 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> GetLiveMetricsAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.GetRequestCosts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.GetRequestCosts.g.cs new file mode 100644 index 00000000..7991a647 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.GetRequestCosts.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILogsMetricsClient + { + /// + /// Get Request Costs + /// + /// + /// + /// 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 GetRequestCostsAsync( + + global::DeepInfra.RequestCostQuery request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Request Costs + /// + /// + /// + /// 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> GetRequestCostsAsResponseAsync( + + global::DeepInfra.RequestCostQuery request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Request Costs + /// + /// + /// + /// 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 GetRequestCostsAsync( + global::System.Collections.Generic.IList requestIds, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.LogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.LogsQuery.g.cs new file mode 100644 index 00000000..4004fea8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.LogsQuery.g.cs @@ -0,0 +1,76 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ILogsMetricsClient + { + /// + /// Logs Query
+ /// Query inference logs.
+ /// * Without timestamps (from/to) returns last `limit` messages (in last month).
+ /// * With `from` only, returns first `limit` messages after `from` (inclusive).
+ /// * With `to` only, returns last `limit` messages before `to` (inclusive).
+ /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
+ /// * `from` and `to` should be no more than a month apart. + ///
+ /// + /// the deploy id to get the logs from + /// + /// + /// start of period, in fractional seconds since unix epoch (inclusive) + /// + /// + /// end of period, in fractional seconds since unix epoch (exclusive) + /// + /// + /// how many items to return at most (default 100, in [1, 1000])
+ /// Default Value: 100 + /// + /// + /// 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 LogsQueryAsync( + string deployId, + string? from = default, + string? to = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Logs Query
+ /// Query inference logs.
+ /// * Without timestamps (from/to) returns last `limit` messages (in last month).
+ /// * With `from` only, returns first `limit` messages after `from` (inclusive).
+ /// * With `to` only, returns last `limit` messages before `to` (inclusive).
+ /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
+ /// * `from` and `to` should be no more than a month apart. + ///
+ /// + /// the deploy id to get the logs from + /// + /// + /// start of period, in fractional seconds since unix epoch (inclusive) + /// + /// + /// end of period, in fractional seconds since unix epoch (exclusive) + /// + /// + /// how many items to return at most (default 100, in [1, 1000])
+ /// Default Value: 100 + /// + /// + /// 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> LogsQueryAsResponseAsync( + string deployId, + string? from = default, + string? to = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.g.cs new file mode 100644 index 00000000..88e2a74f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Query inference logs, deployment logs, and usage metrics.
+ /// 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 ILogsMetricsClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.GetHardware.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.GetHardware.g.cs new file mode 100644 index 00000000..5c2ea815 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.GetHardware.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Get Hardware + /// + /// + /// Model name (NVIDIA NemoClaw format) + /// + /// + /// 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 GetHardwareAsync( + string model, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Hardware + /// + /// + /// Model name (NVIDIA NemoClaw format) + /// + /// + /// 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> GetHardwareAsResponseAsync( + string model, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelDelete.g.cs new file mode 100644 index 00000000..e1c9a096 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelDelete.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Model Delete + /// + /// + /// + /// delete a particular version, pass 'ALL' to wipe everything + /// + /// + /// 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 ModelDeleteAsync( + string modelName, + string version, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Delete + /// + /// + /// + /// delete a particular version, pass 'ALL' to wipe everything + /// + /// + /// 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> ModelDeleteAsResponseAsync( + string modelName, + string version, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelFamiliesNames.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelFamiliesNames.g.cs new file mode 100644 index 00000000..01b7ccae --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelFamiliesNames.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Model Families Names + /// + /// 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> ModelFamiliesNamesAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Families Names + /// + /// 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>> ModelFamiliesNamesAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelFamily.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelFamily.g.cs new file mode 100644 index 00000000..f751de05 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelFamily.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Model Family + /// + /// + /// 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 ModelFamilyAsync( + string familyName, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Family + /// + /// + /// 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> ModelFamilyAsResponseAsync( + string familyName, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelMetaUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelMetaUpdate.g.cs new file mode 100644 index 00000000..aecc0f8c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelMetaUpdate.g.cs @@ -0,0 +1,81 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Model Meta Update + /// + /// + /// + /// + /// 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 ModelMetaUpdateAsync( + string modelName, + + global::DeepInfra.ModelMetaIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Meta Update + /// + /// + /// + /// + /// 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> ModelMetaUpdateAsResponseAsync( + string modelName, + + global::DeepInfra.ModelMetaIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Meta Update + /// + /// + /// + /// + /// short model description in plain text + /// + /// + /// source code project link (empty to delete) + /// + /// + /// paper/research link (empty to delete) + /// + /// + /// usage license link (empty to delete) + /// + /// + /// markdown flavored model readme + /// + /// + /// dataurl or regular url to cover image (empty to delete) + /// + /// + /// model type + /// + /// 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 ModelMetaUpdateAsync( + string modelName, + string? xiApiKey = default, + string? description = default, + string? githubUrl = default, + string? paperUrl = default, + string? licenseUrl = default, + string? readme = default, + string? coverImgUrl = default, + global::DeepInfra.HFTasksE? reportedType = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelPublicity.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelPublicity.g.cs new file mode 100644 index 00000000..60fc656f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelPublicity.g.cs @@ -0,0 +1,57 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Model Publicity + /// + /// + /// + /// + /// 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 ModelPublicityAsync( + string modelName, + + global::DeepInfra.ModelPublicityIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Publicity + /// + /// + /// + /// + /// 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> ModelPublicityAsResponseAsync( + string modelName, + + global::DeepInfra.ModelPublicityIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Publicity + /// + /// + /// + /// + /// whether to make the model public of private + /// + /// 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 ModelPublicityAsync( + string modelName, + bool @public, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelSchema.g.cs new file mode 100644 index 00000000..f412a07b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelSchema.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Model Schema + /// + /// + /// + /// + /// + /// 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 ModelSchemaAsync( + string modelName, + global::DeepInfra.SchemaVariantKey variantKey, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Schema + /// + /// + /// + /// + /// + /// 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> ModelSchemaAsResponseAsync( + string modelName, + global::DeepInfra.SchemaVariantKey variantKey, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelVersions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelVersions.g.cs new file mode 100644 index 00000000..9a20cbb4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelVersions.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Model Versions + /// + /// + /// + /// 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> ModelVersionsAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Model Versions + /// + /// + /// + /// 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>> ModelVersionsAsResponseAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsDeploymentList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsDeploymentList.g.cs new file mode 100644 index 00000000..1523dbfc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsDeploymentList.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Models Deployment List + /// + /// + /// 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> ModelsDeploymentListAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Models Deployment List + /// + /// + /// 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>> ModelsDeploymentListAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsFeatured.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsFeatured.g.cs new file mode 100644 index 00000000..7d8bf384 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsFeatured.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Models Featured + /// + /// 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> ModelsFeaturedAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Models Featured + /// + /// 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>> ModelsFeaturedAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsInfo.g.cs new file mode 100644 index 00000000..ff772c1d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsInfo.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Models Info + /// + /// + /// + /// + /// 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 ModelsInfoAsync( + string modelName, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Models Info + /// + /// + /// + /// + /// 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> ModelsInfoAsResponseAsync( + string modelName, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsList.g.cs new file mode 100644 index 00000000..79c9d26d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsList.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Models List + /// + /// 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> ModelsListAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Models List + /// + /// 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>> ModelsListAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsLoraList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsLoraList.g.cs new file mode 100644 index 00000000..a9a27dec --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsLoraList.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Models Lora List + /// + /// 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> ModelsLoraListAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Models Lora List + /// + /// 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>> ModelsLoraListAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.OpenaiModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.OpenaiModels.g.cs new file mode 100644 index 00000000..56a92e80 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.OpenaiModels.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Openai Models + /// + /// + /// + /// + /// 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 OpenaiModelsAsync( + string? sortBy = default, + string? filter = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Models + /// + /// + /// + /// + /// 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> OpenaiModelsAsResponseAsync( + string? sortBy = default, + string? filter = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.OpenrouterModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.OpenrouterModels.g.cs new file mode 100644 index 00000000..b829c9c9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.OpenrouterModels.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Openrouter Models + /// + /// 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 OpenrouterModelsAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openrouter Models + /// + /// 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> OpenrouterModelsAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.PrivateModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.PrivateModelsList.g.cs new file mode 100644 index 00000000..1ed2706d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.PrivateModelsList.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IModelsClient + { + /// + /// Private Models List + /// + /// + /// 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> PrivateModelsListAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Private Models List + /// + /// + /// 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>> PrivateModelsListAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.g.cs new file mode 100644 index 00000000..a6126fa9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Browse, search, and manage AI models.
+ /// 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 IModelsClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.OpenaiCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.OpenaiCompletions.g.cs new file mode 100644 index 00000000..83f23f00 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.OpenaiCompletions.g.cs @@ -0,0 +1,155 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ITextCompletionsClient + { + /// + /// Openai Completions + /// + /// + /// + /// + /// 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 OpenaiCompletionsAsync( + + global::DeepInfra.OpenAICompletionsIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Completions + /// + /// + /// + /// + /// 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> OpenaiCompletionsAsResponseAsync( + + global::DeepInfra.OpenAICompletionsIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Completions + /// + /// + /// + /// + /// model name + /// + /// + /// input prompt - a single string is currently supported + /// + /// + /// The maximum number of tokens to generate in the completion.
+ /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. + /// + /// + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
+ /// Default Value: 1F + /// + /// + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
+ /// Default Value: 1F + /// + /// + /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
+ /// Default Value: 0F + /// + /// + /// Sample from the best k (number of) tokens. 0 means off
+ /// Default Value: 0 + /// + /// + /// number of sequences to return
+ /// Default Value: 1 + /// + /// + /// whether to stream the output via SSE or return the full response
+ /// Default Value: false + /// + /// + /// return top tokens and their log-probabilities + /// + /// + /// return prompt as part of the respons + /// + /// + /// up to 16 sequences where the API will stop generating further tokens + /// + /// + /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// The format of the response. Currently, only json is supported. + /// + /// + /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
+ /// Default Value: 1 + /// + /// + /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. + /// + /// + /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. + /// + /// + /// streaming options + /// + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + /// + /// return tokens as token ids + /// + /// + /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. + /// + /// + /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). + /// + /// 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 OpenaiCompletionsAsync( + string model, + global::DeepInfra.AnyOf> prompt, + string? xDeepinfraSource = default, + string? xiApiKey = default, + int? maxTokens = default, + double? temperature = default, + double? topP = default, + double? minP = default, + int? topK = default, + int? n = default, + bool? stream = default, + int? logprobs = default, + bool? echo = default, + global::DeepInfra.AnyOf, object>? stop = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::DeepInfra.AnyOf? responseFormat = default, + double? repetitionPenalty = default, + string? user = default, + int? seed = default, + global::DeepInfra.StreamOptions? streamOptions = default, + global::System.Collections.Generic.IList? stopTokenIds = default, + bool? returnTokensAsTokenIds = default, + string? promptCacheKey = default, + global::DeepInfra.CompletionMultiModalData? data = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.g.cs new file mode 100644 index 00000000..9bef335f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI-compatible text completion endpoints.
+ /// 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 ITextCompletionsClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.CreateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.CreateVoice.g.cs new file mode 100644 index 00000000..e1d77155 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.CreateVoice.g.cs @@ -0,0 +1,105 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ITextToSpeechClient + { + /// + /// Create Voice
+ /// Create a new voice + ///
+ /// + /// + /// 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 CreateVoiceAsync( + + global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Voice
+ /// Create a new voice + ///
+ /// + /// + /// 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> CreateVoiceAsResponseAsync( + + global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Voice
+ /// Create a new voice + ///
+ /// + /// + /// + /// + /// 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 CreateVoiceAsync( + string name, + string description, + global::System.Collections.Generic.IList files, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create Voice
+ /// Create a new voice + ///
+ /// + /// + /// + /// + /// The streams to send as multipart 'files' file parts. + /// + /// + /// Optional file names to use for the multipart 'files' file parts. + /// + /// 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 CreateVoiceAsync( + string name, + string description, + global::System.Collections.Generic.IReadOnlyList files, + string? xiApiKey = default, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Voice
+ /// Create a new voice + ///
+ /// + /// + /// + /// + /// The streams to send as multipart 'files' file parts. + /// + /// + /// Optional file names to use for the multipart 'files' file parts. + /// + /// 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> CreateVoiceAsResponseAsync( + string name, + string description, + global::System.Collections.Generic.IReadOnlyList files, + string? xiApiKey = default, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.DeleteVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.DeleteVoice.g.cs new file mode 100644 index 00000000..0d53b48d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.DeleteVoice.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ITextToSpeechClient + { + /// + /// Delete Voice + /// + /// + /// + /// 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 DeleteVoiceAsync( + string voiceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Voice + /// + /// + /// + /// 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> DeleteVoiceAsResponseAsync( + string voiceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.GetVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.GetVoice.g.cs new file mode 100644 index 00000000..1445614b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.GetVoice.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ITextToSpeechClient + { + /// + /// Get Voice
+ /// Get a voice by its id + ///
+ /// + /// + /// 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 GetVoiceAsync( + string voiceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Voice
+ /// Get a voice by its id + ///
+ /// + /// + /// 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> GetVoiceAsResponseAsync( + string voiceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.GetVoices.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.GetVoices.g.cs new file mode 100644 index 00000000..c719d961 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.GetVoices.g.cs @@ -0,0 +1,32 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ITextToSpeechClient + { + /// + /// Get Voices
+ /// Get available voices for a given user + ///
+ /// + /// 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 GetVoicesAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Voices
+ /// Get available voices for a given user + ///
+ /// + /// 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> GetVoicesAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.TextToSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.TextToSpeech.g.cs new file mode 100644 index 00000000..4e18eb70 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.TextToSpeech.g.cs @@ -0,0 +1,77 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ITextToSpeechClient + { + /// + /// Text To Speech + /// + /// + /// + /// + /// + /// 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 TextToSpeechAsync( + string voiceId, + + global::DeepInfra.ElevenLabsTextToSpeechIn request, + string? outputFormat = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text To Speech + /// + /// + /// + /// + /// + /// 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> TextToSpeechAsResponseAsync( + string voiceId, + + global::DeepInfra.ElevenLabsTextToSpeechIn request, + string? outputFormat = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text To Speech + /// + /// + /// + /// + /// + /// Text to convert to speech + /// + /// + /// Model ID to use for the conversion
+ /// Default Value: hexgrad/Kokoro-82M + /// + /// + /// Output format for the speech
+ /// Default Value: wav + /// + /// + /// ISO 639-1, 2 letter language code + /// + /// 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 TextToSpeechAsync( + string voiceId, + string text, + string? outputFormat = default, + string? xiApiKey = default, + string? modelId = default, + global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, + string? languageCode = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.TextToSpeechStream.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.TextToSpeechStream.g.cs new file mode 100644 index 00000000..86f2c7da --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.TextToSpeechStream.g.cs @@ -0,0 +1,77 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ITextToSpeechClient + { + /// + /// Text To Speech Stream + /// + /// + /// + /// + /// + /// 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 TextToSpeechStreamAsync( + string voiceId, + + global::DeepInfra.ElevenLabsTextToSpeechIn request, + string? outputFormat = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text To Speech Stream + /// + /// + /// + /// + /// + /// 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> TextToSpeechStreamAsResponseAsync( + string voiceId, + + global::DeepInfra.ElevenLabsTextToSpeechIn request, + string? outputFormat = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Text To Speech Stream + /// + /// + /// + /// + /// + /// Text to convert to speech + /// + /// + /// Model ID to use for the conversion
+ /// Default Value: hexgrad/Kokoro-82M + /// + /// + /// Output format for the speech
+ /// Default Value: wav + /// + /// + /// ISO 639-1, 2 letter language code + /// + /// 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 TextToSpeechStreamAsync( + string voiceId, + string text, + string? outputFormat = default, + string? xiApiKey = default, + string? modelId = default, + global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, + string? languageCode = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.UpdateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.UpdateVoice.g.cs new file mode 100644 index 00000000..1ead5516 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.UpdateVoice.g.cs @@ -0,0 +1,57 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ITextToSpeechClient + { + /// + /// Update Voice + /// + /// + /// + /// + /// 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 UpdateVoiceAsync( + string voiceId, + + global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Voice + /// + /// + /// + /// + /// 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> UpdateVoiceAsResponseAsync( + string voiceId, + + global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Voice + /// + /// + /// + /// + /// + /// 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 UpdateVoiceAsync( + string voiceId, + string name, + string description, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.g.cs new file mode 100644 index 00000000..11d30f6f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// ElevenLabs-compatible TTS endpoints and voice management.
+ /// 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 ITextToSpeechClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.CliVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.CliVersion.g.cs new file mode 100644 index 00000000..9f65a9bd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.CliVersion.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IUtilitiesClient + { + /// + /// Cli Version + /// + /// + /// 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 CliVersionAsync( + string version, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cli Version + /// + /// + /// 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> CliVersionAsResponseAsync( + string version, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.SubmitFeedback.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.SubmitFeedback.g.cs new file mode 100644 index 00000000..0ccd40b5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.SubmitFeedback.g.cs @@ -0,0 +1,58 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IUtilitiesClient + { + /// + /// Submit Feedback
+ /// Submit feedback + ///
+ /// + /// + /// 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 SubmitFeedbackAsync( + + global::DeepInfra.FeedbackIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Submit Feedback
+ /// Submit feedback + ///
+ /// + /// + /// 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> SubmitFeedbackAsResponseAsync( + + global::DeepInfra.FeedbackIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Submit Feedback
+ /// Submit feedback + ///
+ /// + /// + /// The message you'd like to send to deepinfra team + /// + /// + /// Optional contact email to reach you back + /// + /// 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 SubmitFeedbackAsync( + string message, + string? xiApiKey = default, + string? contactEmail = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.g.cs new file mode 100644 index 00000000..ceba85b5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Feedback submission and CLI version.
+ /// 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 IUtilitiesClient : 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::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesEdits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesEdits.g.cs new file mode 100644 index 00000000..b42de331 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesEdits.g.cs @@ -0,0 +1,1566 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ImageGenerationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiImagesEditsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiImagesEditsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiImagesEditsSecurityRequirement0, + }; + partial void PrepareOpenaiImagesEditsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request); + partial void PrepareOpenaiImagesEditsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request); + partial void ProcessOpenaiImagesEditsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiImagesEditsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Images Edits
+ /// Edit image using OpenAI Images Edits API + ///
+ /// + /// + /// 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 OpenaiImagesEditsAsync( + + global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiImagesEditsAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Images Edits
+ /// Edit image using OpenAI Images Edits API + ///
+ /// + /// + /// 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> OpenaiImagesEditsAsResponseAsync( + + global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenaiImagesEditsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiImagesEditsSecurityRequirements, + operationName: "OpenaiImagesEditsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/images/edits", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesEditsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.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); + ProcessOpenaiImagesEditsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiImagesEditsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Openai Images Edits
+ /// Edit image using OpenAI Images Edits API + ///
+ /// + /// + /// + /// + /// + /// + /// 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 OpenaiImagesEditsAsync( + byte[] image, + string imagename, + string prompt, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesEditsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost + { + Image = image, + Imagename = imagename, + Inp = inp, + Prompt = prompt, + Model = model, + }; + + return await OpenaiImagesEditsAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Openai Images Edits
+ /// Edit image using OpenAI Images Edits API + ///
+ /// + /// + /// The stream to send as the multipart 'image' file part. + /// + /// + /// + /// + /// + /// 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 OpenaiImagesEditsAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesEditsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Inp = inp, + Prompt = prompt, + Model = model, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiImagesEditsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiImagesEditsSecurityRequirements, + operationName: "OpenaiImagesEditsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/images/edits", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesEditsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.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); + ProcessOpenaiImagesEditsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiImagesEditsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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); + + return + await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Images Edits
+ /// Edit image using OpenAI Images Edits API + ///
+ /// + /// + /// The stream to send as the multipart 'image' file part. + /// + /// + /// + /// + /// + /// 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> OpenaiImagesEditsAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string prompt, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesEditsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Inp = inp, + Prompt = prompt, + Model = model, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiImagesEditsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiImagesEditsSecurityRequirements, + operationName: "OpenaiImagesEditsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/images/edits", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesEditsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.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); + ProcessOpenaiImagesEditsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesEdits", + methodName: "OpenaiImagesEditsAsync", + pathTemplate: "\"/v1/images/edits\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiImagesEditsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesGenerations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesGenerations.g.cs new file mode 100644 index 00000000..7b162c12 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesGenerations.g.cs @@ -0,0 +1,555 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ImageGenerationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiImagesGenerationsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiImagesGenerationsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiImagesGenerationsSecurityRequirement0, + }; + partial void PrepareOpenaiImagesGenerationsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.OpenAIImagesGenerationsIn request); + partial void PrepareOpenaiImagesGenerationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.OpenAIImagesGenerationsIn request); + partial void ProcessOpenaiImagesGenerationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiImagesGenerationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Images Generations
+ /// Generate image using OpenAI Images API + ///
+ /// + /// + /// 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 OpenaiImagesGenerationsAsync( + + global::DeepInfra.OpenAIImagesGenerationsIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiImagesGenerationsAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Images Generations
+ /// Generate image using OpenAI Images API + ///
+ /// + /// + /// 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> OpenaiImagesGenerationsAsResponseAsync( + + global::DeepInfra.OpenAIImagesGenerationsIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenaiImagesGenerationsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiImagesGenerationsSecurityRequirements, + operationName: "OpenaiImagesGenerationsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/images/generations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesGenerationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesGenerations", + methodName: "OpenaiImagesGenerationsAsync", + pathTemplate: "\"/v1/images/generations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesGenerations", + methodName: "OpenaiImagesGenerationsAsync", + pathTemplate: "\"/v1/images/generations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesGenerations", + methodName: "OpenaiImagesGenerationsAsync", + pathTemplate: "\"/v1/images/generations\"", + 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::DeepInfra.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); + ProcessOpenaiImagesGenerationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesGenerations", + methodName: "OpenaiImagesGenerationsAsync", + pathTemplate: "\"/v1/images/generations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesGenerations", + methodName: "OpenaiImagesGenerationsAsync", + pathTemplate: "\"/v1/images/generations\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiImagesGenerationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Openai Images Generations
+ /// Generate image using OpenAI Images API + ///
+ /// + /// + /// The model to use for image generation. + /// + /// + /// The number of images to generate.
+ /// Default Value: 1 + /// + /// + /// The format in which the generated images are returned. Currently only b64_json is supported.
+ /// Default Value: b64_json + /// + /// + /// The size of the generated images. Available sizes depend on the model.
+ /// Default Value: 1024x1024 + /// + /// + /// A unique identifier representing your end-user, which can help to monitor and detect abuse. + /// + /// + /// A text description of desired image(s). + /// + /// + /// The quality of the image that will be generated. + /// + /// + /// The style of the generated images. + /// + /// 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 OpenaiImagesGenerationsAsync( + string model, + string prompt, + string? xiApiKey = default, + int? n = default, + global::DeepInfra.OpenAIImagesResponseFormat? responseFormat = default, + string? size = default, + string? user = default, + string? quality = default, + string? style = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAIImagesGenerationsIn + { + Model = model, + N = n, + ResponseFormat = responseFormat, + Size = size, + User = user, + Prompt = prompt, + Quality = quality, + Style = style, + }; + + return await OpenaiImagesGenerationsAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesVariations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesVariations.g.cs new file mode 100644 index 00000000..f5d2c456 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesVariations.g.cs @@ -0,0 +1,1545 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ImageGenerationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiImagesVariationsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiImagesVariationsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiImagesVariationsSecurityRequirement0, + }; + partial void PrepareOpenaiImagesVariationsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request); + partial void PrepareOpenaiImagesVariationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request); + partial void ProcessOpenaiImagesVariationsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiImagesVariationsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Images Variations
+ /// Generate a similar image using OpenAI Images Variations API + ///
+ /// + /// + /// 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 OpenaiImagesVariationsAsync( + + global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiImagesVariationsAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Images Variations
+ /// Generate a similar image using OpenAI Images Variations API + ///
+ /// + /// + /// 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> OpenaiImagesVariationsAsResponseAsync( + + global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenaiImagesVariationsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiImagesVariationsSecurityRequirements, + operationName: "OpenaiImagesVariationsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/images/variations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesVariationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.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); + ProcessOpenaiImagesVariationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiImagesVariationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Openai Images Variations
+ /// Generate a similar image using OpenAI Images Variations API + ///
+ /// + /// + /// + /// + /// + /// 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 OpenaiImagesVariationsAsync( + byte[] image, + string imagename, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesVariationsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost + { + Image = image, + Imagename = imagename, + Inp = inp, + Model = model, + }; + + return await OpenaiImagesVariationsAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Openai Images Variations
+ /// Generate a similar image using OpenAI Images Variations API + ///
+ /// + /// + /// The stream to send as the multipart 'image' file part. + /// + /// + /// + /// + /// 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 OpenaiImagesVariationsAsync( + global::System.IO.Stream image, + string imagename, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesVariationsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Inp = inp, + Model = model, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiImagesVariationsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiImagesVariationsSecurityRequirements, + operationName: "OpenaiImagesVariationsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/images/variations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesVariationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.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); + ProcessOpenaiImagesVariationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiImagesVariationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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); + + return + await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Images Variations
+ /// Generate a similar image using OpenAI Images Variations API + ///
+ /// + /// + /// The stream to send as the multipart 'image' file part. + /// + /// + /// + /// + /// 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> OpenaiImagesVariationsAsResponseAsync( + global::System.IO.Stream image, + string imagename, + string model, + string? xiApiKey = default, + global::DeepInfra.OpenAIImagesVariationsIn? inp = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + var request = new global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost + { + Image = global::System.Array.Empty(), + Imagename = imagename, + Inp = inp, + Model = model, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiImagesVariationsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiImagesVariationsSecurityRequirements, + operationName: "OpenaiImagesVariationsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/images/variations", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesVariationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.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); + ProcessOpenaiImagesVariationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiImagesVariations", + methodName: "OpenaiImagesVariationsAsync", + pathTemplate: "\"/v1/images/variations\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiImagesVariationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.g.cs new file mode 100644 index 00000000..64ed9da5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Generate, edit, and create variations of images.
+ /// 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 ImageGenerationClient : global::DeepInfra.IImageGenerationClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ImageGenerationClient. + /// 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 ImageGenerationClient( + 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 ImageGenerationClient 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 ImageGenerationClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ImageGenerationClient. + /// 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 ImageGenerationClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.InferenceClient.InferenceDeploy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.InferenceDeploy.g.cs new file mode 100644 index 00000000..aec336fd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.InferenceDeploy.g.cs @@ -0,0 +1,546 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class InferenceClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_InferenceDeploySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_InferenceDeploySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_InferenceDeploySecurityRequirement0, + }; + partial void PrepareInferenceDeployArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? xiApiKey); + partial void PrepareInferenceDeployRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey); + partial void ProcessInferenceDeployResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessInferenceDeployResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Inference Deploy + /// + /// + /// + /// 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 InferenceDeployAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InferenceDeployAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Inference Deploy + /// + /// + /// + /// 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> InferenceDeployAsResponseAsync( + string deployId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareInferenceDeployArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_InferenceDeploySecurityRequirements, + operationName: "InferenceDeployAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/inference/deploy/{deployId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareInferenceDeployRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InferenceDeploy", + methodName: "InferenceDeployAsync", + pathTemplate: "$\"/v1/inference/deploy/{deployId}\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InferenceDeploy", + methodName: "InferenceDeployAsync", + pathTemplate: "$\"/v1/inference/deploy/{deployId}\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InferenceDeploy", + methodName: "InferenceDeployAsync", + pathTemplate: "$\"/v1/inference/deploy/{deployId}\"", + 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::DeepInfra.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); + ProcessInferenceDeployResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InferenceDeploy", + methodName: "InferenceDeployAsync", + pathTemplate: "$\"/v1/inference/deploy/{deployId}\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InferenceDeploy", + methodName: "InferenceDeployAsync", + pathTemplate: "$\"/v1/inference/deploy/{deployId}\"", + 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); + } + // Forbidden + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::DeepInfra.DeepError? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessInferenceDeployResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.InferenceModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.InferenceModel.g.cs new file mode 100644 index 00000000..d394fae7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.InferenceModel.g.cs @@ -0,0 +1,599 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class InferenceClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_InferenceModelSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_InferenceModelSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_InferenceModelSecurityRequirement0, + }; + partial void PrepareInferenceModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelName, + ref string? version, + ref string? xiApiKey); + partial void PrepareInferenceModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? version, + string? xiApiKey); + partial void ProcessInferenceModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessInferenceModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Inference Model + /// + /// + /// + /// model version to run inference against + /// + /// + /// 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 InferenceModelAsync( + string modelName, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InferenceModelAsResponseAsync( + modelName: modelName, + version: version, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Inference Model + /// + /// + /// + /// model version to run inference against + /// + /// + /// 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> InferenceModelAsResponseAsync( + string modelName, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareInferenceModelArguments( + httpClient: HttpClient, + modelName: ref modelName, + version: ref version, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_InferenceModelSecurityRequirements, + operationName: "InferenceModelAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/inference/{modelName}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("version", version) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareInferenceModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + version: version, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InferenceModel", + methodName: "InferenceModelAsync", + pathTemplate: "$\"/v1/inference/{modelName}\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InferenceModel", + methodName: "InferenceModelAsync", + pathTemplate: "$\"/v1/inference/{modelName}\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InferenceModel", + methodName: "InferenceModelAsync", + pathTemplate: "$\"/v1/inference/{modelName}\"", + 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::DeepInfra.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); + ProcessInferenceModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InferenceModel", + methodName: "InferenceModelAsync", + pathTemplate: "$\"/v1/inference/{modelName}\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "InferenceModel", + methodName: "InferenceModelAsync", + pathTemplate: "$\"/v1/inference/{modelName}\"", + 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); + } + // Forbidden + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::DeepInfra.DeepError? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Locked + if ((int)__response.StatusCode == 423) + { + string? __content_423 = null; + global::System.Exception? __exception_423 = null; + global::DeepInfra.DeepError? __value_423 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_423 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); + } + else + { + __content_423 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_423 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_423, + responseBody: __content_423, + responseObject: __value_423, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessInferenceModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.g.cs new file mode 100644 index 00000000..d5fb864a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Native DeepInfra inference API for models and deployments.
+ /// 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 InferenceClient : global::DeepInfra.IInferenceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the InferenceClient. + /// 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 InferenceClient( + 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 InferenceClient 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 InferenceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the InferenceClient. + /// 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 InferenceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceState.g.cs new file mode 100644 index 00000000..851d468b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class AgentInstanceStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.AgentInstanceState 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::DeepInfra.AgentInstanceStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.AgentInstanceState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.AgentInstanceState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.AgentInstanceState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.AgentInstanceStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceStateNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceStateNullable.g.cs new file mode 100644 index 00000000..1ddc50b6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class AgentInstanceStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.AgentInstanceState? 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::DeepInfra.AgentInstanceStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.AgentInstanceState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.AgentInstanceState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.AgentInstanceState? 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::DeepInfra.AgentInstanceStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf2.g.cs index eecc50b1..081bae0a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf2.g.cs @@ -107,7 +107,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Serialization catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null) + { try { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf3.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf3.g.cs index 96f1cf5e..554e0bca 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf3.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf3.g.cs @@ -137,7 +137,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Serializa catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null) + { try { @@ -151,7 +154,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Serializa catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null) + { try { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf4.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf4.g.cs index 30633aa6..f4c4636e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf4.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf4.g.cs @@ -167,7 +167,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Seria catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { @@ -181,7 +184,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Seria catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { @@ -195,7 +201,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Seria catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf5.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf5.g.cs index d1167b4b..eefa6abf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf5.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf5.g.cs @@ -197,7 +197,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.S catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { try { @@ -211,7 +214,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.S catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { try { @@ -225,7 +231,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.S catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { try { @@ -239,7 +248,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.S catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { try { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf8.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf8.g.cs deleted file mode 100644 index 91d0be5f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf8.g.cs +++ /dev/null @@ -1,470 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> - { - /// - public override global::DeepInfra.AnyOf Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); - var __rawJson = __jsonDocument.RootElement.GetRawText(); - var __jsonProps = new global::System.Collections.Generic.HashSet(); - if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) - { - foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) - { - __jsonProps.Add(__jsonProp.Name); - } - } - - var __score0 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score0++; - } - } - } - var __score1 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score1++; - } - } - } - var __score2 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T3), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score2++; - } - } - } - var __score3 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T4), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score3++; - } - } - } - var __score4 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T5), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score4++; - } - } - } - var __score5 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T6), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score5++; - } - } - } - var __score6 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T7), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score6++; - } - } - } - var __score7 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T8), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score7++; - } - } - } - var __bestScore = 0; - var __bestIndex = -1; - if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } - if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } - if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } - if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } - if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; } - if (__score5 > __bestScore) { __bestScore = __score5; __bestIndex = 5; } - if (__score6 > __bestScore) { __bestScore = __score6; __bestIndex = 6; } - if (__score7 > __bestScore) { __bestScore = __score7; __bestIndex = 7; } - - T1? value1 = default; - T2? value2 = default; - T3? value3 = default; - T4? value4 = default; - T5? value5 = default; - T6? value6 = default; - T7? value7 = default; - T8? value8 = default; - if (__bestIndex >= 0) - { - if (__bestIndex == 0) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); - value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 1) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); - value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 2) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); - value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 3) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); - value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 4) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); - value5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 5) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); - value6 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 6) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); - value7 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 7) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); - value8 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - } - - if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); - value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); - value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); - value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); - value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); - value5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); - value6 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); - value7 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); - value8 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - var __value = new global::DeepInfra.AnyOf( - value1, - - value2, - - value3, - - value4, - - value5, - - value6, - - value7, - - value8 - ); - - return __value; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.AnyOf value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsValue1) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!, typeInfo); - } - else if (value.IsValue2) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo); - } - else if (value.IsValue3) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3!, typeInfo); - } - else if (value.IsValue4) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value4!, typeInfo); - } - else if (value.IsValue5) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value5!, typeInfo); - } - else if (value.IsValue6) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value6!, typeInfo); - } - else if (value.IsValue7) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value7!, typeInfo); - } - else if (value.IsValue8) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value8!, typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf9.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf9.g.cs new file mode 100644 index 00000000..b862eaa4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf9.g.cs @@ -0,0 +1,546 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + { + /// + public override global::DeepInfra.AnyOf Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + } + } + + var __score0 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score0++; + } + } + } + var __score1 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score1++; + } + } + } + var __score2 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T3), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score2++; + } + } + } + var __score3 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T4), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score3++; + } + } + } + var __score4 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T5), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score4++; + } + } + } + var __score5 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T6), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score5++; + } + } + } + var __score6 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T7), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score6++; + } + } + } + var __score7 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T8), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score7++; + } + } + } + var __score8 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T9), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score8++; + } + } + } + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } + if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } + if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; } + if (__score5 > __bestScore) { __bestScore = __score5; __bestIndex = 5; } + if (__score6 > __bestScore) { __bestScore = __score6; __bestIndex = 6; } + if (__score7 > __bestScore) { __bestScore = __score7; __bestIndex = 7; } + if (__score8 > __bestScore) { __bestScore = __score8; __bestIndex = 8; } + + T1? value1 = default; + T2? value2 = default; + T3? value3 = default; + T4? value4 = default; + T5? value5 = default; + T6? value6 = default; + T7? value7 = default; + T8? value8 = default; + T9? value9 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 1) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 2) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 3) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 4) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + value5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 5) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); + value6 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 6) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); + value7 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 7) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); + value8 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 8) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T9).Name}"); + value9 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + value5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); + value6 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); + value7 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); + value8 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T9).Name}"); + value9 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::DeepInfra.AnyOf( + value1, + + value2, + + value3, + + value4, + + value5, + + value6, + + value7, + + value8, + + value9 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.AnyOf value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsValue1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!, typeInfo); + } + else if (value.IsValue2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo); + } + else if (value.IsValue3) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3!, typeInfo); + } + else if (value.IsValue4) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value4!, typeInfo); + } + else if (value.IsValue5) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value5!, typeInfo); + } + else if (value.IsValue6) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value6!, typeInfo); + } + else if (value.IsValue7) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value7!, typeInfo); + } + else if (value.IsValue8) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value8!, typeInfo); + } + else if (value.IsValue9) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T9).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value9!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs deleted file mode 100644 index 3bd3c2b9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Extensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2 value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Extensions.ToValueString(value)); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Nullable.g.cs deleted file mode 100644 index 9add7282..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Nullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Extensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Extensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs deleted file mode 100644 index 48466e4d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullable.g.cs deleted file mode 100644 index a0d6fb8c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item? 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item? 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs deleted file mode 100644 index d3e92f0f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Extensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2 value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Extensions.ToValueString(value)); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Nullable.g.cs deleted file mode 100644 index 52613df3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Nullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Extensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Extensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetState.g.cs new file mode 100644 index 00000000..6e0f75b4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenclawListV1AgentsGetStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenclawListV1AgentsGetState 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::DeepInfra.OpenclawListV1AgentsGetStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenclawListV1AgentsGetState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenclawListV1AgentsGetState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenclawListV1AgentsGetState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.OpenclawListV1AgentsGetStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetStateNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetStateNullable.g.cs new file mode 100644 index 00000000..5f66c6ef --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenclawListV1AgentsGetStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenclawListV1AgentsGetState? 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::DeepInfra.OpenclawListV1AgentsGetStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenclawListV1AgentsGetState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenclawListV1AgentsGetState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenclawListV1AgentsGetState? 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::DeepInfra.OpenclawListV1AgentsGetStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs index 3fd9bb26..d5900c03 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs @@ -17,6 +17,10 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.SuspendReasonNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.AgentInstanceStateJsonConverter), + + typeof(global::DeepInfra.JsonConverters.AgentInstanceStateNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2JsonConverter), typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2NullableJsonConverter), @@ -25,22 +29,10 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2JsonConverter), - - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2NullableJsonConverter), - - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemJsonConverter), - - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2JsonConverter), typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2NullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2JsonConverter), - - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2NullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.ChatReasoningSettingsEffort2JsonConverter), typeof(global::DeepInfra.JsonConverters.ChatReasoningSettingsEffort2NullableJsonConverter), @@ -121,6 +113,10 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.ContainerRentalsListV1ContainersGetStateNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.OpenclawListV1AgentsGetStateJsonConverter), + + typeof(global::DeepInfra.JsonConverters.OpenclawListV1AgentsGetStateNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter, object>), @@ -133,15 +129,15 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>>), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>>), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), @@ -159,19 +155,21 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter, string>), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), typeof(global::DeepInfra.JsonConverters.UnixTimestampJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.JsonSerializerContextTypes))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AddFundsIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BillingPortalOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AddFundsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BillingAddress))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BillingPortalOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.Checklist))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SuspendReason))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ConfigIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ConfigOut))] @@ -181,7 +179,14 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.HTTPValidationError))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ValidationError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.InvoiceListItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.InvoicesOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelMeta))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PaymentMethodBankInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PaymentMethodCardInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PaymentMethodCashAppInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PaymentMethodInfo))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.TimeInterval))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.TopUpIn))] @@ -194,6 +199,7 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AgentInstanceState), TypeInfoPropertyName = "AgentInstanceState2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnthropicMessagesIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf, object>), TypeInfoPropertyName = "AnyOfStringIListAnthropicSystemContentObject2")] @@ -215,22 +221,13 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item), TypeInfoPropertyName = "BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item), TypeInfoPropertyName = "BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiFilesV1FilesPost))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIImagesEditsIn))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIImagesVariationsIn))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionAssistantMessage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf, object>), TypeInfoPropertyName = "AnyOfStringIListChatCompletionContentPartTextObject2")] @@ -242,14 +239,16 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.InputAudio))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionContentPartImage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ImageURL))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionContentPartVideo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.VideoURL))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.Function))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionSystemMessage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>), TypeInfoPropertyName = "AnyOfStringIListChatCompletionContentPartText2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionToolMessage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionUserMessage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>>), TypeInfoPropertyName = "AnyOfStringIListAnyOfChatCompletionContentPartTextChatCompletionContentPartImageChatCompletionContentPartAudio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfChatCompletionContentPartTextChatCompletionContentPartImageChatCompletionContentPartAudio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>>), TypeInfoPropertyName = "ChatCompletionContentPartVideo_ba71f0f0ed6c3c8a")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>), TypeInfoPropertyName = "ChatCompletionContentPartVideo_42446b6a8b5bc71f")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "ChatCompletionContentPartVideo_564b9ad0201a3c82")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatReasoningSettings))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatReasoningSettingsEffort2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatTools))] @@ -280,7 +279,8 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployStatusOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployType), TypeInfoPropertyName = "DeployType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentLogQueryOut))] - [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.IList>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentMainStatsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentStatsOut))] @@ -328,7 +328,7 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelFieldInfo))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelInfoOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfModelPricingTimeModelPricingUptimeModelPricingTokensModelPricingInputLengthModelPricingInputTokensModelPricingInputCharacterLengthModelPricingImageUnitsModelPricingOutputLength2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "ModelPricingFrameUnits_74364e10aab2ab1b")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelPricingTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelPricingUptime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelPricingTokens))] @@ -337,14 +337,16 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelPricingInputCharacterLength))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelPricingImageUnits))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelPricingOutputLength))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelPricingFrameUnits))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SchemaVariant))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelMetaIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelMetadata))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelNameSuggestionOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelOut))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfModelPricingTimeModelPricingTokensModelPricingInputLengthModelPricingInputTokensModelPricingUptimeModelPricingInputCharacterLengthModelPricingImageUnitsModelPricingOutputLength2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "ModelPricingFrameUnits_b60964b5ebc3097b")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelPublicityIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelVersionOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIBatch))] @@ -354,6 +356,7 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfChatCompletionToolMessageChatCompletionAssistantMessageChatCompletionUserMessageChatCompletionSystemMessage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf, object>), TypeInfoPropertyName = "AnyOfStringIListStringObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfStringChatToolsObject2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfTextResponseFormatJsonObjectResponseFormatJsonSchemaResponseFormatRegexResponseFormatObject2")] @@ -363,7 +366,6 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAICompletionsIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>), TypeInfoPropertyName = "AnyOfStringIListInt322")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIEmbeddingsIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ServiceTier))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf, string>), TypeInfoPropertyName = "AnyOfIListStringString2")] @@ -377,6 +379,16 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIModelsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAITextToSpeechIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawAgentTypeMetaOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawPlanOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawBackupOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawCreateIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawCreateOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawInstanceOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawLaunchTokenOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawUpdateIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenRouterDatacenter))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenRouterModelData))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenRouterPricing))] @@ -403,6 +415,7 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.UpdateLoraApiRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.WebLiveMetricsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ContainerRentalsListV1ContainersGetState), TypeInfoPropertyName = "ContainerRentalsListV1ContainersGetState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenclawListV1AgentsGetState), TypeInfoPropertyName = "OpenclawListV1AgentsGetState2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -410,7 +423,14 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>>?), TypeInfoPropertyName = "ChatCompletionContentPartVideo_da2c47f6e81dd0c4")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf?), TypeInfoPropertyName = "ChatCompletionContentPartVideo_06f031293c314952")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf?), TypeInfoPropertyName = "ModelPricingFrameUnits_6ea86b27c5e04f0a")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf?), TypeInfoPropertyName = "ModelPricingFrameUnits_ed89053ab1900c9d")] [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>))] @@ -421,15 +441,15 @@ namespace DeepInfra [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::DeepInfra.AnyOf, object>))] [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::DeepInfra.AnyOf>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>>), TypeInfoPropertyName = "ChatCompletionContentPartVideo_fbe3cba047b686e0")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>), TypeInfoPropertyName = "ChatCompletionContentPartVideo_0799573126f8224b")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [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>))] [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))] @@ -439,12 +459,13 @@ namespace DeepInfra [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::DeepInfra.AnyOf, object>))] + [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::DeepInfra.AnyOf>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf, string>))] [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))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -456,6 +477,8 @@ namespace DeepInfra [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))] public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext { } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs index 5a8cdcaf..e5fbc86d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs @@ -36,7 +36,7 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::DeepInfra.BillingPortalOut? Type2 { get; set; } + public global::DeepInfra.AddFundsOut? Type2 { get; set; } /// /// /// @@ -44,331 +44,331 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::DeepInfra.Checklist? Type4 { get; set; } + public object? Type4 { get; set; } /// /// /// - public bool? Type5 { get; set; } + public global::DeepInfra.BillingAddress? Type5 { get; set; } /// /// /// - public double? Type6 { get; set; } + public global::DeepInfra.BillingPortalOut? Type6 { get; set; } /// /// /// - public object? Type7 { get; set; } + public global::DeepInfra.Checklist? Type7 { get; set; } /// /// /// - public global::DeepInfra.SuspendReason? Type8 { get; set; } + public bool? Type8 { get; set; } /// /// /// - public global::DeepInfra.ConfigIn? Type9 { get; set; } + public double? Type9 { get; set; } /// /// /// - public global::DeepInfra.ConfigOut? Type10 { get; set; } + public global::DeepInfra.SuspendReason? Type10 { get; set; } /// /// /// - public global::DeepInfra.DeepStartApplicationIn? Type11 { get; set; } + public global::DeepInfra.ConfigIn? Type11 { get; set; } /// /// /// - public global::DeepInfra.DeepStartApplicationOut? Type12 { get; set; } + public global::DeepInfra.ConfigOut? Type12 { get; set; } /// /// /// - public global::DeepInfra.DiscountMeta? Type13 { get; set; } + public global::DeepInfra.DeepStartApplicationIn? Type13 { get; set; } /// /// /// - public global::DeepInfra.HTTPValidationError? Type14 { get; set; } + public global::DeepInfra.DeepStartApplicationOut? Type14 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type15 { get; set; } + public global::DeepInfra.DiscountMeta? Type15 { get; set; } /// /// /// - public global::DeepInfra.ValidationError? Type16 { get; set; } + public global::DeepInfra.HTTPValidationError? Type16 { get; set; } /// /// /// - public global::DeepInfra.ModelMeta? Type17 { get; set; } + public global::System.Collections.Generic.IList? Type17 { get; set; } /// /// /// - public global::DeepInfra.TimeInterval? Type18 { get; set; } + public global::DeepInfra.ValidationError? Type18 { get; set; } /// /// /// - public long? Type19 { get; set; } + public global::DeepInfra.InvoiceListItem? Type19 { get; set; } /// /// /// - public global::DeepInfra.TopUpIn? Type20 { get; set; } + public global::DeepInfra.InvoicesOut? Type20 { get; set; } /// /// /// - public global::DeepInfra.UsageItem? Type21 { get; set; } + public global::System.Collections.Generic.IList? Type21 { get; set; } /// /// /// - public global::DeepInfra.UsageMonth? Type22 { get; set; } + public global::DeepInfra.ModelMeta? Type22 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type23 { get; set; } + public global::DeepInfra.PaymentMethodBankInfo? Type23 { get; set; } /// /// /// - public global::DeepInfra.UsageOut? Type24 { get; set; } + public global::DeepInfra.PaymentMethodCardInfo? Type24 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type25 { get; set; } + public global::DeepInfra.PaymentMethodCashAppInfo? Type25 { get; set; } /// /// /// - public global::DeepInfra.UsageRentOut? Type26 { get; set; } + public global::DeepInfra.PaymentMethodInfo? Type26 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type27 { get; set; } + public global::DeepInfra.TimeInterval? Type27 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type28 { get; set; } + public long? Type28 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type29 { get; set; } + public global::DeepInfra.TopUpIn? Type29 { get; set; } /// /// /// - public global::DeepInfra.AnthropicMessagesIn? Type30 { get; set; } + public global::DeepInfra.UsageItem? Type30 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type31 { get; set; } + public global::DeepInfra.UsageMonth? Type31 { get; set; } /// /// /// - public global::DeepInfra.AnyOf, object>? Type32 { get; set; } + public global::System.Collections.Generic.IList? Type32 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type33 { get; set; } + public global::DeepInfra.UsageOut? Type33 { get; set; } /// /// /// - public global::DeepInfra.AnthropicSystemContent? Type34 { get; set; } + public global::System.Collections.Generic.IList? Type34 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type35 { get; set; } + public global::DeepInfra.UsageRentOut? Type35 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type36 { get; set; } + public global::System.Collections.Generic.Dictionary? Type36 { get; set; } /// /// /// - public global::DeepInfra.AnthropicTool? Type37 { get; set; } + public global::System.Collections.Generic.IList>? Type37 { get; set; } /// /// /// - public global::DeepInfra.AnthropicThinkingConfig? Type38 { get; set; } + public global::DeepInfra.AnyOf? Type38 { get; set; } /// /// /// - public global::DeepInfra.AnthropicTokenCountRequest? Type39 { get; set; } + public global::DeepInfra.AgentInstanceState? Type39 { get; set; } /// /// /// - public global::DeepInfra.ApiToken? Type40 { get; set; } + public global::DeepInfra.AnthropicMessagesIn? Type40 { get; set; } /// /// /// - public global::System.DateTimeOffset? Type41 { get; set; } + public global::System.Collections.Generic.IList? Type41 { get; set; } /// /// /// - public global::DeepInfra.ApiTokenIn? Type42 { get; set; } + public global::DeepInfra.AnyOf, object>? Type42 { get; set; } /// /// /// - public global::DeepInfra.ApiTokenVercelExportIn? Type43 { get; set; } + public global::System.Collections.Generic.IList? Type43 { get; set; } /// /// /// - public global::DeepInfra.BodyCreateVoiceV1VoicesAddPost? Type44 { get; set; } + public global::DeepInfra.AnthropicSystemContent? Type44 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type45 { get; set; } + public global::System.Collections.Generic.IList? Type45 { get; set; } /// /// /// - public byte[]? Type46 { get; set; } + public global::System.Collections.Generic.IList? Type46 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost? Type47 { get; set; } + public global::DeepInfra.AnthropicTool? Type47 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? Type48 { get; set; } + public global::DeepInfra.AnthropicThinkingConfig? Type48 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type49 { get; set; } + public global::DeepInfra.AnthropicTokenCountRequest? Type49 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item? Type50 { get; set; } + public global::DeepInfra.ApiToken? Type50 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost? Type51 { get; set; } + public global::System.DateTimeOffset? Type51 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? Type52 { get; set; } + public global::DeepInfra.ApiTokenIn? Type52 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type53 { get; set; } + public global::DeepInfra.ApiTokenVercelExportIn? Type53 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item? Type54 { get; set; } + public global::DeepInfra.BodyCreateVoiceV1VoicesAddPost? Type54 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost? Type55 { get; set; } + public global::System.Collections.Generic.IList? Type55 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? Type56 { get; set; } + public byte[]? Type56 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost? Type57 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost? Type57 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? Type58 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? Type58 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiFilesV1FilesPost? Type59 { get; set; } + public global::System.Collections.Generic.IList? Type59 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost? Type60 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item? Type60 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost? Type61 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost? Type61 { get; set; } /// /// /// - public global::DeepInfra.OpenAIImagesEditsIn? Type62 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? Type62 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost? Type63 { get; set; } + public global::DeepInfra.BodyOpenaiFilesV1FilesPost? Type63 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost? Type64 { get; set; } + public global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost? Type64 { get; set; } /// /// /// - public global::DeepInfra.OpenAIImagesVariationsIn? Type65 { get; set; } + public global::DeepInfra.OpenAIImagesEditsIn? Type65 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost? Type66 { get; set; } + public global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost? Type66 { get; set; } /// /// /// - public global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost? Type67 { get; set; } + public global::DeepInfra.OpenAIImagesVariationsIn? Type67 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionAssistantMessage? Type68 { get; set; } + public global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost? Type68 { get; set; } /// /// /// - public global::DeepInfra.AnyOf, object>? Type69 { get; set; } + public global::DeepInfra.ChatCompletionAssistantMessage? Type69 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type70 { get; set; } + public global::DeepInfra.AnyOf, object>? Type70 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionContentPartText? Type71 { get; set; } + public global::System.Collections.Generic.IList? Type71 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type72 { get; set; } + public global::DeepInfra.ChatCompletionContentPartText? Type72 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionMessageToolCall? Type73 { get; set; } + public global::System.Collections.Generic.IList? Type73 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionContentPartAudio? Type74 { get; set; } + public global::DeepInfra.ChatCompletionMessageToolCall? Type74 { get; set; } /// /// /// - public global::DeepInfra.InputAudio? Type75 { get; set; } + public global::DeepInfra.ChatCompletionContentPartAudio? Type75 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionContentPartImage? Type76 { get; set; } + public global::DeepInfra.InputAudio? Type76 { get; set; } /// /// /// - public global::DeepInfra.ImageURL? Type77 { get; set; } + public global::DeepInfra.ChatCompletionContentPartImage? Type77 { get; set; } /// /// /// - public global::DeepInfra.Function? Type78 { get; set; } + public global::DeepInfra.ImageURL? Type78 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionSystemMessage? Type79 { get; set; } + public global::DeepInfra.ChatCompletionContentPartVideo? Type79 { get; set; } /// /// /// - public global::DeepInfra.AnyOf>? Type80 { get; set; } + public global::DeepInfra.VideoURL? Type80 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionToolMessage? Type81 { get; set; } + public global::DeepInfra.Function? Type81 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionUserMessage? Type82 { get; set; } + public global::DeepInfra.ChatCompletionSystemMessage? Type82 { get; set; } /// /// /// - public global::DeepInfra.AnyOf>>? Type83 { get; set; } + public global::DeepInfra.AnyOf>? Type83 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type84 { get; set; } + public global::DeepInfra.ChatCompletionToolMessage? Type84 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type85 { get; set; } + public global::DeepInfra.ChatCompletionUserMessage? Type85 { get; set; } /// /// /// @@ -492,199 +492,199 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.Dictionary>? Type116 { get; set; } + public global::System.Collections.Generic.Dictionary>>? Type116 { get; set; } /// /// /// - public global::DeepInfra.DeploymentMainStatsOut? Type117 { get; set; } + public global::System.Collections.Generic.IList>? Type117 { get; set; } /// /// /// - public global::DeepInfra.DeploymentOut? Type118 { get; set; } + public global::DeepInfra.DeploymentMainStatsOut? Type118 { get; set; } /// /// /// - public global::DeepInfra.DeploymentStatsOut? Type119 { get; set; } + public global::DeepInfra.DeploymentOut? Type119 { get; set; } /// /// /// - public global::DeepInfra.DetailedDeploymentStatsOut? Type120 { get; set; } + public global::DeepInfra.DeploymentStatsOut? Type120 { get; set; } /// /// /// - public global::DeepInfra.LLMDeploymentStatsOut? Type121 { get; set; } + public global::DeepInfra.DetailedDeploymentStatsOut? Type121 { get; set; } /// /// /// - public global::DeepInfra.EmbeddingsDeploymentStatsOut? Type122 { get; set; } + public global::DeepInfra.LLMDeploymentStatsOut? Type122 { get; set; } /// /// /// - public global::DeepInfra.TimeDeploymentStatsOut? Type123 { get; set; } + public global::DeepInfra.EmbeddingsDeploymentStatsOut? Type123 { get; set; } /// /// /// - public global::DeepInfra.DisplayNameIn? Type124 { get; set; } + public global::DeepInfra.TimeDeploymentStatsOut? Type124 { get; set; } /// /// /// - public global::DeepInfra.ElevenLabsTextToSpeechIn? Type125 { get; set; } + public global::DeepInfra.DisplayNameIn? Type125 { get; set; } /// /// /// - public global::DeepInfra.TtsResponseFormat? Type126 { get; set; } + public global::DeepInfra.ElevenLabsTextToSpeechIn? Type126 { get; set; } /// /// /// - public global::DeepInfra.EmailsOut? Type127 { get; set; } + public global::DeepInfra.TtsResponseFormat? Type127 { get; set; } /// /// /// - public global::DeepInfra.FAQEntryOut? Type128 { get; set; } + public global::DeepInfra.EmailsOut? Type128 { get; set; } /// /// /// - public global::DeepInfra.FeedbackIn? Type129 { get; set; } + public global::DeepInfra.FAQEntryOut? Type129 { get; set; } /// /// /// - public global::DeepInfra.GetVoicesOut? Type130 { get; set; } + public global::DeepInfra.FeedbackIn? Type130 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type131 { get; set; } + public global::DeepInfra.GetVoicesOut? Type131 { get; set; } /// /// /// - public global::DeepInfra.Voice? Type132 { get; set; } + public global::System.Collections.Generic.IList? Type132 { get; set; } /// /// /// - public global::DeepInfra.GpuLimitOut? Type133 { get; set; } + public global::DeepInfra.Voice? Type133 { get; set; } /// /// /// - public global::DeepInfra.GpuLimitRequestIn? Type134 { get; set; } + public global::DeepInfra.GpuLimitOut? Type134 { get; set; } /// /// /// - public global::DeepInfra.HFModel? Type135 { get; set; } + public global::DeepInfra.GpuLimitRequestIn? Type135 { get; set; } /// /// /// - public global::DeepInfra.HFTasksE? Type136 { get; set; } + public global::DeepInfra.HFModel? Type136 { get; set; } /// /// /// - public global::DeepInfra.HardwareOption? Type137 { get; set; } + public global::DeepInfra.HFTasksE? Type137 { get; set; } /// /// /// - public global::DeepInfra.HardwareOptionType? Type138 { get; set; } + public global::DeepInfra.HardwareOption? Type138 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type139 { get; set; } + public global::DeepInfra.HardwareOptionType? Type139 { get; set; } /// /// /// - public global::DeepInfra.HardwarePricingServerless? Type140 { get; set; } + public global::DeepInfra.AnyOf? Type140 { get; set; } /// /// /// - public global::DeepInfra.HardwarePricingDedicated? Type141 { get; set; } + public global::DeepInfra.HardwarePricingServerless? Type141 { get; set; } /// /// /// - public global::DeepInfra.HardwareResponse? Type142 { get; set; } + public global::DeepInfra.HardwarePricingDedicated? Type142 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type143 { get; set; } + public global::DeepInfra.HardwareResponse? Type143 { get; set; } /// /// /// - public global::DeepInfra.ImageURLDetail? Type144 { get; set; } + public global::System.Collections.Generic.IList? Type144 { get; set; } /// /// /// - public global::DeepInfra.InputAudioFormat? Type145 { get; set; } + public global::DeepInfra.ImageURLDetail? Type145 { get; set; } /// /// /// - public global::DeepInfra.InspectScopedJWTOut? Type146 { get; set; } + public global::DeepInfra.InputAudioFormat? Type146 { get; set; } /// /// /// - public global::DeepInfra.JsonObjectResponseFormat? Type147 { get; set; } + public global::DeepInfra.InspectScopedJWTOut? Type147 { get; set; } /// /// /// - public global::DeepInfra.JsonSchema? Type148 { get; set; } + public global::DeepInfra.JsonObjectResponseFormat? Type148 { get; set; } /// /// /// - public global::DeepInfra.JsonSchemaResponseFormat? Type149 { get; set; } + public global::DeepInfra.JsonSchema? Type149 { get; set; } /// /// /// - public global::DeepInfra.LogQueryOut? Type150 { get; set; } + public global::DeepInfra.JsonSchemaResponseFormat? Type150 { get; set; } /// /// /// - public global::DeepInfra.LoraModelUploadIn? Type151 { get; set; } + public global::DeepInfra.LogQueryOut? Type151 { get; set; } /// /// /// - public global::DeepInfra.Me? Type152 { get; set; } + public global::DeepInfra.LoraModelUploadIn? Type152 { get; set; } /// /// /// - public global::DeepInfra.MeVercelConnection2? Type153 { get; set; } + public global::DeepInfra.Me? Type153 { get; set; } /// /// /// - public global::DeepInfra.MeIn? Type154 { get; set; } + public global::DeepInfra.MeVercelConnection2? Type154 { get; set; } /// /// /// - public global::DeepInfra.ModelDocBlock? Type155 { get; set; } + public global::DeepInfra.MeIn? Type155 { get; set; } /// /// /// - public global::DeepInfra.ModelDocBlockKey? Type156 { get; set; } + public global::DeepInfra.ModelDocBlock? Type156 { get; set; } /// /// /// - public global::DeepInfra.ModelFamilyOut? Type157 { get; set; } + public global::DeepInfra.ModelDocBlockKey? Type157 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type158 { get; set; } + public global::DeepInfra.ModelFamilyOut? Type158 { get; set; } /// /// /// - public global::DeepInfra.PricingPageSectionOut? Type159 { get; set; } + public global::System.Collections.Generic.IList? Type159 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type160 { get; set; } + public global::DeepInfra.PricingPageSectionOut? Type160 { get; set; } /// /// /// - public global::DeepInfra.ModelFieldInfo? Type161 { get; set; } + public global::System.Collections.Generic.IList? Type161 { get; set; } /// /// /// - public global::DeepInfra.ModelInfoOut? Type162 { get; set; } + public global::DeepInfra.ModelFieldInfo? Type162 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type163 { get; set; } + public global::DeepInfra.ModelInfoOut? Type163 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type164 { get; set; } + public global::System.Collections.Generic.IList? Type164 { get; set; } /// /// /// @@ -720,63 +720,63 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.IList? Type173 { get; set; } + public global::DeepInfra.ModelPricingFrameUnits? Type173 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type174 { get; set; } + public global::System.Collections.Generic.IList? Type174 { get; set; } /// /// /// - public global::DeepInfra.SchemaVariant? Type175 { get; set; } + public global::System.Collections.Generic.IList? Type175 { get; set; } /// /// /// - public global::DeepInfra.ModelMetaIn? Type176 { get; set; } + public global::DeepInfra.SchemaVariant? Type176 { get; set; } /// /// /// - public global::DeepInfra.ModelMetadata? Type177 { get; set; } + public global::DeepInfra.ModelMetaIn? Type177 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type178 { get; set; } + public global::DeepInfra.ModelMetadata? Type178 { get; set; } /// /// /// - public global::DeepInfra.ModelOut? Type179 { get; set; } + public global::System.Collections.Generic.Dictionary? Type179 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type180 { get; set; } + public global::DeepInfra.ModelNameSuggestionOut? Type180 { get; set; } /// /// /// - public global::DeepInfra.ModelPublicityIn? Type181 { get; set; } + public global::DeepInfra.ModelOut? Type181 { get; set; } /// /// /// - public global::DeepInfra.ModelVersionOut? Type182 { get; set; } + public global::DeepInfra.ModelPublicityIn? Type182 { get; set; } /// /// /// - public global::DeepInfra.OpenAIBatch? Type183 { get; set; } + public global::DeepInfra.ModelVersionOut? Type183 { get; set; } /// /// /// - public global::DeepInfra.OpenAIBatchesIn? Type184 { get; set; } + public global::DeepInfra.OpenAIBatch? Type184 { get; set; } /// /// /// - public global::DeepInfra.OpenAIBatchesInEndpoint? Type185 { get; set; } + public global::DeepInfra.OpenAIBatchesIn? Type185 { get; set; } /// /// /// - public global::DeepInfra.OpenAIChatCompletionsIn? Type186 { get; set; } + public global::DeepInfra.OpenAIBatchesInEndpoint? Type186 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type187 { get; set; } + public global::DeepInfra.OpenAIChatCompletionsIn? Type187 { get; set; } /// /// /// @@ -788,43 +788,43 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.IList? Type190 { get; set; } + public global::System.Collections.Generic.IList? Type190 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type191 { get; set; } + public global::System.Collections.Generic.IList? Type191 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type192 { get; set; } + public global::DeepInfra.AnyOf? Type192 { get; set; } /// /// /// - public global::DeepInfra.TextResponseFormat? Type193 { get; set; } + public global::DeepInfra.AnyOf? Type193 { get; set; } /// /// /// - public global::DeepInfra.RegexResponseFormat? Type194 { get; set; } + public global::DeepInfra.TextResponseFormat? Type194 { get; set; } /// /// /// - public global::DeepInfra.StreamOptions? Type195 { get; set; } + public global::DeepInfra.RegexResponseFormat? Type195 { get; set; } /// /// /// - public global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? Type196 { get; set; } + public global::DeepInfra.StreamOptions? Type196 { get; set; } /// /// /// - public global::DeepInfra.OpenAICompletionsIn? Type197 { get; set; } + public global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? Type197 { get; set; } /// /// /// - public global::DeepInfra.AnyOf>? Type198 { get; set; } + public global::DeepInfra.OpenAICompletionsIn? Type198 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type199 { get; set; } + public global::DeepInfra.AnyOf>? Type199 { get; set; } /// /// /// @@ -880,135 +880,187 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::DeepInfra.OpenRouterDatacenter? Type213 { get; set; } + public global::DeepInfra.OpenClawAgentTypeMetaOut? Type213 { get; set; } /// /// /// - public global::DeepInfra.OpenRouterModelData? Type214 { get; set; } + public global::System.Collections.Generic.IList? Type214 { get; set; } /// /// /// - public global::DeepInfra.OpenRouterPricing? Type215 { get; set; } + public global::DeepInfra.OpenClawPlanOut? Type215 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type216 { get; set; } + public global::DeepInfra.OpenClawBackupOut? Type216 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type217 { get; set; } + public global::System.Collections.Generic.Dictionary? Type217 { get; set; } /// /// /// - public global::DeepInfra.OpenRouterModelsOut? Type218 { get; set; } + public global::DeepInfra.OpenClawCreateIn? Type218 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type219 { get; set; } + public global::DeepInfra.OpenClawCreateOut? Type219 { get; set; } /// /// /// - public global::DeepInfra.PricingPageEntryOut? Type220 { get; set; } + public global::DeepInfra.OpenClawInstanceOut? Type220 { get; set; } /// /// /// - public global::DeepInfra.PricingType? Type221 { get; set; } + public global::DeepInfra.OpenClawLaunchTokenOut? Type221 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type222 { get; set; } + public global::DeepInfra.OpenClawUpdateIn? Type222 { get; set; } /// /// /// - public global::DeepInfra.RateLimitOut? Type223 { get; set; } + public global::DeepInfra.OpenRouterDatacenter? Type223 { get; set; } /// /// /// - public global::DeepInfra.RateLimitRequestIn? Type224 { get; set; } + public global::DeepInfra.OpenRouterModelData? Type224 { get; set; } /// /// /// - public global::DeepInfra.RequestCostItem? Type225 { get; set; } + public global::DeepInfra.OpenRouterPricing? Type225 { get; set; } /// /// /// - public global::DeepInfra.RequestCostQuery? Type226 { get; set; } + public global::System.Collections.Generic.Dictionary? Type226 { get; set; } /// /// /// - public global::DeepInfra.RequestCostResponse? Type227 { get; set; } + public global::System.Collections.Generic.IList? Type227 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type228 { get; set; } + public global::DeepInfra.OpenRouterModelsOut? Type228 { get; set; } /// /// /// - public global::DeepInfra.SchemaOut? Type229 { get; set; } + public global::System.Collections.Generic.IList? Type229 { get; set; } /// /// /// - public global::DeepInfra.SchemaVariantKey? Type230 { get; set; } + public global::DeepInfra.PricingPageEntryOut? Type230 { get; set; } /// /// /// - public global::DeepInfra.ScopedJWTIn? Type231 { get; set; } + public global::DeepInfra.PricingType? Type231 { get; set; } /// /// /// - public global::DeepInfra.ScopedJWTOut? Type232 { get; set; } + public global::System.Collections.Generic.IList? Type232 { get; set; } /// /// /// - public global::DeepInfra.SourceTypeEnum? Type233 { get; set; } + public global::DeepInfra.RateLimitOut? Type233 { get; set; } /// /// /// - public global::DeepInfra.SshKeyIn? Type234 { get; set; } + public global::DeepInfra.RateLimitRequestIn? Type234 { get; set; } /// /// /// - public global::DeepInfra.SshKeyOut? Type235 { get; set; } + public global::DeepInfra.RequestCostItem? Type235 { get; set; } /// /// /// - public global::DeepInfra.UpdateLoraApiRequest? Type236 { get; set; } + public global::DeepInfra.RequestCostQuery? Type236 { get; set; } /// /// /// - public global::DeepInfra.WebLiveMetricsOut? Type237 { get; set; } + public global::DeepInfra.RequestCostResponse? Type237 { get; set; } /// /// /// - public global::DeepInfra.ContainerRentalsListV1ContainersGetState? Type238 { get; set; } + public global::System.Collections.Generic.IList? Type238 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type239 { get; set; } + public global::DeepInfra.SchemaOut? Type239 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type240 { get; set; } + public global::DeepInfra.SchemaVariantKey? Type240 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type241 { get; set; } + public global::DeepInfra.ScopedJWTIn? Type241 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type242 { get; set; } + public global::DeepInfra.ScopedJWTOut? Type242 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type243 { get; set; } + public global::DeepInfra.SourceTypeEnum? Type243 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type244 { get; set; } + public global::DeepInfra.SshKeyIn? Type244 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type245 { get; set; } + public global::DeepInfra.SshKeyOut? Type245 { get; set; } + /// + /// + /// + public global::DeepInfra.UpdateLoraApiRequest? Type246 { get; set; } + /// + /// + /// + public global::DeepInfra.WebLiveMetricsOut? Type247 { get; set; } + /// + /// + /// + public global::DeepInfra.ContainerRentalsListV1ContainersGetState? Type248 { get; set; } + /// + /// + /// + public global::DeepInfra.OpenclawListV1AgentsGetState? Type249 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type250 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type251 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type252 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type253 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type254 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type255 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type256 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type257 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type258 { get; set; } /// /// @@ -1017,47 +1069,47 @@ 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::DeepInfra.AnyOf, object>? ListType5 { get; set; } + public global::System.Collections.Generic.List? ListType5 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType6 { get; set; } + public global::DeepInfra.AnyOf, object>? 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; } /// /// /// @@ -1077,122 +1129,126 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::DeepInfra.AnyOf>>? ListType16 { get; set; } + public global::System.Collections.Generic.List? ListType16 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.Dictionary>>? ListType17 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType17 { get; set; } + public global::System.Collections.Generic.List>? ListType18 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType18 { get; set; } + public global::System.Collections.Generic.List? ListType19 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? ListType19 { get; set; } + public global::System.Collections.Generic.List? ListType20 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType20 { get; set; } + public global::System.Collections.Generic.List? ListType21 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType21 { get; set; } + public global::System.Collections.Generic.List? ListType22 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType22 { get; set; } + public global::System.Collections.Generic.List? ListType23 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType23 { get; set; } + public global::System.Collections.Generic.List? ListType24 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType24 { get; set; } + public global::System.Collections.Generic.List? ListType25 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType25 { get; set; } + public global::DeepInfra.AnyOf, object>? ListType26 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType26 { get; set; } + public global::System.Collections.Generic.List? ListType27 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType27 { get; set; } + public global::System.Collections.Generic.List? ListType28 { get; set; } /// /// /// - public global::DeepInfra.AnyOf, object>? ListType28 { get; set; } + public global::DeepInfra.AnyOf>? ListType29 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType29 { get; set; } + public global::DeepInfra.AnyOf, string>? ListType30 { get; set; } /// /// /// - public global::DeepInfra.AnyOf>? ListType30 { get; set; } + public global::System.Collections.Generic.List? ListType31 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType31 { get; set; } + public global::System.Collections.Generic.List? ListType32 { get; set; } /// /// /// - public global::DeepInfra.AnyOf, string>? ListType32 { get; set; } + public global::System.Collections.Generic.List? ListType33 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType33 { get; set; } + public global::System.Collections.Generic.List? ListType34 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType34 { get; set; } + public global::System.Collections.Generic.List? ListType35 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType35 { get; set; } + public global::System.Collections.Generic.List? ListType36 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType36 { get; set; } + public global::System.Collections.Generic.List? ListType37 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType37 { get; set; } + public global::System.Collections.Generic.List? ListType38 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType38 { get; set; } + public global::System.Collections.Generic.List? ListType39 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType39 { get; set; } + public global::System.Collections.Generic.List? ListType40 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType40 { get; set; } + public global::System.Collections.Generic.List? ListType41 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType41 { get; set; } + public global::System.Collections.Generic.List? ListType42 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType42 { get; set; } + public global::System.Collections.Generic.List? ListType43 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType43 { get; set; } + public global::System.Collections.Generic.List? ListType44 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType44 { get; set; } + public global::System.Collections.Generic.List? ListType45 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType45 { get; set; } + public global::System.Collections.Generic.List? ListType46 { get; set; } } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.CreateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.CreateLora.g.cs new file mode 100644 index 00000000..0209fd2f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.CreateLora.g.cs @@ -0,0 +1,524 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LoRAAdaptersClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateLoraSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_CreateLoraSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateLoraSecurityRequirement0, + }; + partial void PrepareCreateLoraArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.CreateLoraApiRequest request); + partial void PrepareCreateLoraRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.CreateLoraApiRequest request); + partial void ProcessCreateLoraResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateLoraResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Lora + /// + /// + /// + /// 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 CreateLoraAsync( + + global::DeepInfra.CreateLoraApiRequest request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateLoraAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Lora + /// + /// + /// + /// 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> CreateLoraAsResponseAsync( + + global::DeepInfra.CreateLoraApiRequest request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateLoraArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateLoraSecurityRequirements, + operationName: "CreateLoraAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/lora/create", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateLoraRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateLora", + methodName: "CreateLoraAsync", + pathTemplate: "\"/v1/lora/create\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateLora", + methodName: "CreateLoraAsync", + pathTemplate: "\"/v1/lora/create\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateLora", + methodName: "CreateLoraAsync", + pathTemplate: "\"/v1/lora/create\"", + 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::DeepInfra.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); + ProcessCreateLoraResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateLora", + methodName: "CreateLoraAsync", + pathTemplate: "\"/v1/lora/create\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateLora", + methodName: "CreateLoraAsync", + pathTemplate: "\"/v1/lora/create\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessCreateLoraResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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 Lora + /// + /// + /// + /// + /// + /// + /// + /// 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 CreateLoraAsync( + string baseModel, + string loraName, + global::DeepInfra.SourceModel source, + bool @private, + string? xiApiKey = default, + string? description = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.CreateLoraApiRequest + { + BaseModel = baseModel, + LoraName = loraName, + Source = source, + Private = @private, + Description = description, + }; + + return await CreateLoraAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.DeleteLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.DeleteLora.g.cs new file mode 100644 index 00000000..07515ca0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.DeleteLora.g.cs @@ -0,0 +1,472 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LoRAAdaptersClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeleteLoraSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeleteLoraSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeleteLoraSecurityRequirement0, + }; + partial void PrepareDeleteLoraArguments( + global::System.Net.Http.HttpClient httpClient, + ref string loraName, + ref string? xiApiKey); + partial void PrepareDeleteLoraRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loraName, + string? xiApiKey); + partial void ProcessDeleteLoraResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteLoraResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Lora + /// + /// + /// + /// 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 DeleteLoraAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteLoraAsResponseAsync( + loraName: loraName, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Lora + /// + /// + /// + /// 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> DeleteLoraAsResponseAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteLoraArguments( + httpClient: HttpClient, + loraName: ref loraName, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteLoraSecurityRequirements, + operationName: "DeleteLoraAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/lora/{loraName}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteLoraRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + loraName: loraName!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteLora", + methodName: "DeleteLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteLora", + methodName: "DeleteLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteLora", + methodName: "DeleteLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "DELETE", + 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::DeepInfra.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); + ProcessDeleteLoraResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteLora", + methodName: "DeleteLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteLora", + methodName: "DeleteLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "DELETE", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeleteLoraResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.DeleteLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.DeleteLoraModel.g.cs new file mode 100644 index 00000000..52c538c8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.DeleteLoraModel.g.cs @@ -0,0 +1,509 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LoRAAdaptersClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeleteLoraModelSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeleteLoraModelSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeleteLoraModelSecurityRequirement0, + }; + partial void PrepareDeleteLoraModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref string loraModelName, + ref string? xiApiKey); + partial void PrepareDeleteLoraModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loraModelName, + string? xiApiKey); + partial void ProcessDeleteLoraModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteLoraModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Lora Model + /// + /// + /// + /// 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 DeleteLoraModelAsync( + string loraModelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteLoraModelAsResponseAsync( + loraModelName: loraModelName, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Lora Model + /// + /// + /// + /// 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> DeleteLoraModelAsResponseAsync( + string loraModelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteLoraModelArguments( + httpClient: HttpClient, + loraModelName: ref loraModelName, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteLoraModelSecurityRequirements, + operationName: "DeleteLoraModelAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/lora-model/{loraModelName}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteLoraModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + loraModelName: loraModelName!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteLoraModel", + methodName: "DeleteLoraModelAsync", + pathTemplate: "$\"/lora-model/{loraModelName}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteLoraModel", + methodName: "DeleteLoraModelAsync", + pathTemplate: "$\"/lora-model/{loraModelName}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteLoraModel", + methodName: "DeleteLoraModelAsync", + pathTemplate: "$\"/lora-model/{loraModelName}\"", + httpMethod: "DELETE", + 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::DeepInfra.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); + ProcessDeleteLoraModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteLoraModel", + methodName: "DeleteLoraModelAsync", + pathTemplate: "$\"/lora-model/{loraModelName}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteLoraModel", + methodName: "DeleteLoraModelAsync", + pathTemplate: "$\"/lora-model/{loraModelName}\"", + httpMethod: "DELETE", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeleteLoraModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetLora.g.cs new file mode 100644 index 00000000..181cd2d7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetLora.g.cs @@ -0,0 +1,472 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LoRAAdaptersClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetLoraSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetLoraSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetLoraSecurityRequirement0, + }; + partial void PrepareGetLoraArguments( + global::System.Net.Http.HttpClient httpClient, + ref string loraName, + ref string? xiApiKey); + partial void PrepareGetLoraRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loraName, + string? xiApiKey); + partial void ProcessGetLoraResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetLoraResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Lora + /// + /// + /// + /// 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 GetLoraAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetLoraAsResponseAsync( + loraName: loraName, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Lora + /// + /// + /// + /// 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> GetLoraAsResponseAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetLoraArguments( + httpClient: HttpClient, + loraName: ref loraName, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetLoraSecurityRequirements, + operationName: "GetLoraAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/lora/{loraName}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetLoraRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + loraName: loraName!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLora", + methodName: "GetLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLora", + methodName: "GetLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLora", + methodName: "GetLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetLoraResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLora", + methodName: "GetLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLora", + methodName: "GetLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetLoraResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetLoraStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetLoraStatus.g.cs new file mode 100644 index 00000000..97386d7d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetLoraStatus.g.cs @@ -0,0 +1,472 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LoRAAdaptersClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetLoraStatusSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetLoraStatusSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetLoraStatusSecurityRequirement0, + }; + partial void PrepareGetLoraStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string loraName, + ref string? xiApiKey); + partial void PrepareGetLoraStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loraName, + string? xiApiKey); + partial void ProcessGetLoraStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetLoraStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Lora Status + /// + /// + /// + /// 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 GetLoraStatusAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetLoraStatusAsResponseAsync( + loraName: loraName, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Lora Status + /// + /// + /// + /// 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> GetLoraStatusAsResponseAsync( + string loraName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetLoraStatusArguments( + httpClient: HttpClient, + loraName: ref loraName, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetLoraStatusSecurityRequirements, + operationName: "GetLoraStatusAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/lora/{loraName}/status", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetLoraStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + loraName: loraName!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLoraStatus", + methodName: "GetLoraStatusAsync", + pathTemplate: "$\"/v1/lora/{loraName}/status\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLoraStatus", + methodName: "GetLoraStatusAsync", + pathTemplate: "$\"/v1/lora/{loraName}/status\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLoraStatus", + methodName: "GetLoraStatusAsync", + pathTemplate: "$\"/v1/lora/{loraName}/status\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetLoraStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLoraStatus", + methodName: "GetLoraStatusAsync", + pathTemplate: "$\"/v1/lora/{loraName}/status\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLoraStatus", + methodName: "GetLoraStatusAsync", + pathTemplate: "$\"/v1/lora/{loraName}/status\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetLoraStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetModelLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetModelLoras.g.cs new file mode 100644 index 00000000..f1a32822 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetModelLoras.g.cs @@ -0,0 +1,472 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LoRAAdaptersClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetModelLorasSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetModelLorasSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetModelLorasSecurityRequirement0, + }; + partial void PrepareGetModelLorasArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelName, + ref string? xiApiKey); + partial void PrepareGetModelLorasRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? xiApiKey); + partial void ProcessGetModelLorasResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetModelLorasResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Model Loras + /// + /// + /// + /// 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 GetModelLorasAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetModelLorasAsResponseAsync( + modelName: modelName, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Model Loras + /// + /// + /// + /// 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> GetModelLorasAsResponseAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetModelLorasArguments( + httpClient: HttpClient, + modelName: ref modelName, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetModelLorasSecurityRequirements, + operationName: "GetModelLorasAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/model/{modelName}/loras", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetModelLorasRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetModelLoras", + methodName: "GetModelLorasAsync", + pathTemplate: "$\"/v1/model/{modelName}/loras\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetModelLoras", + methodName: "GetModelLorasAsync", + pathTemplate: "$\"/v1/model/{modelName}/loras\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetModelLoras", + methodName: "GetModelLorasAsync", + pathTemplate: "$\"/v1/model/{modelName}/loras\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetModelLorasResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetModelLoras", + methodName: "GetModelLorasAsync", + pathTemplate: "$\"/v1/model/{modelName}/loras\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetModelLoras", + methodName: "GetModelLorasAsync", + pathTemplate: "$\"/v1/model/{modelName}/loras\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetModelLorasResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetUserLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetUserLoras.g.cs new file mode 100644 index 00000000..7948c700 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetUserLoras.g.cs @@ -0,0 +1,463 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LoRAAdaptersClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetUserLorasSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetUserLorasSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetUserLorasSecurityRequirement0, + }; + partial void PrepareGetUserLorasArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareGetUserLorasRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessGetUserLorasResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetUserLorasResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get User Loras + /// + /// + /// 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 GetUserLorasAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetUserLorasAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get User Loras + /// + /// + /// 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> GetUserLorasAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetUserLorasArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetUserLorasSecurityRequirements, + operationName: "GetUserLorasAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/user/loras", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetUserLorasRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetUserLoras", + methodName: "GetUserLorasAsync", + pathTemplate: "\"/v1/user/loras\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetUserLoras", + methodName: "GetUserLorasAsync", + pathTemplate: "\"/v1/user/loras\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetUserLoras", + methodName: "GetUserLorasAsync", + pathTemplate: "\"/v1/user/loras\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetUserLorasResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetUserLoras", + methodName: "GetUserLorasAsync", + pathTemplate: "\"/v1/user/loras\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetUserLoras", + methodName: "GetUserLorasAsync", + pathTemplate: "\"/v1/user/loras\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetUserLorasResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.UpdateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.UpdateLora.g.cs new file mode 100644 index 00000000..aa7ba8de --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.UpdateLora.g.cs @@ -0,0 +1,523 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LoRAAdaptersClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UpdateLoraSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UpdateLoraSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UpdateLoraSecurityRequirement0, + }; + partial void PrepareUpdateLoraArguments( + global::System.Net.Http.HttpClient httpClient, + ref string loraName, + ref string? xiApiKey, + global::DeepInfra.UpdateLoraApiRequest request); + partial void PrepareUpdateLoraRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loraName, + string? xiApiKey, + global::DeepInfra.UpdateLoraApiRequest request); + partial void ProcessUpdateLoraResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUpdateLoraResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update Lora + /// + /// + /// + /// + /// 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 UpdateLoraAsync( + string loraName, + + global::DeepInfra.UpdateLoraApiRequest request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateLoraAsResponseAsync( + loraName: loraName, + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Lora + /// + /// + /// + /// + /// 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> UpdateLoraAsResponseAsync( + string loraName, + + global::DeepInfra.UpdateLoraApiRequest request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUpdateLoraArguments( + httpClient: HttpClient, + loraName: ref loraName, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateLoraSecurityRequirements, + operationName: "UpdateLoraAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/lora/{loraName}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateLoraRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + loraName: loraName!, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateLora", + methodName: "UpdateLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateLora", + methodName: "UpdateLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateLora", + methodName: "UpdateLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "PATCH", + 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::DeepInfra.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); + ProcessUpdateLoraResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateLora", + methodName: "UpdateLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "PATCH", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateLora", + methodName: "UpdateLoraAsync", + pathTemplate: "$\"/v1/lora/{loraName}\"", + httpMethod: "PATCH", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessUpdateLoraResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Update Lora + /// + /// + /// + /// + /// + /// 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 UpdateLoraAsync( + string loraName, + string? xiApiKey = default, + bool? @private = default, + string? description = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.UpdateLoraApiRequest + { + Private = @private, + Description = description, + }; + + return await UpdateLoraAsync( + loraName: loraName, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.UploadLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.UploadLoraModel.g.cs new file mode 100644 index 00000000..ea9ace2d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.UploadLoraModel.g.cs @@ -0,0 +1,558 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LoRAAdaptersClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UploadLoraModelSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UploadLoraModelSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UploadLoraModelSecurityRequirement0, + }; + partial void PrepareUploadLoraModelArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.LoraModelUploadIn request); + partial void PrepareUploadLoraModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.LoraModelUploadIn request); + partial void ProcessUploadLoraModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUploadLoraModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Upload Lora Model + /// + /// + /// + /// 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 UploadLoraModelAsync( + + global::DeepInfra.LoraModelUploadIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UploadLoraModelAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload Lora Model + /// + /// + /// + /// 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> UploadLoraModelAsResponseAsync( + + global::DeepInfra.LoraModelUploadIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUploadLoraModelArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadLoraModelSecurityRequirements, + operationName: "UploadLoraModelAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/lora-model", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadLoraModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadLoraModel", + methodName: "UploadLoraModelAsync", + pathTemplate: "\"/lora-model\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadLoraModel", + methodName: "UploadLoraModelAsync", + pathTemplate: "\"/lora-model\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadLoraModel", + methodName: "UploadLoraModelAsync", + pathTemplate: "\"/lora-model\"", + 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::DeepInfra.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); + ProcessUploadLoraModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadLoraModel", + methodName: "UploadLoraModelAsync", + pathTemplate: "\"/lora-model\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadLoraModel", + methodName: "UploadLoraModelAsync", + pathTemplate: "\"/lora-model\"", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessUploadLoraModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Upload Lora Model + /// + /// + /// + /// + /// + /// + /// 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 UploadLoraModelAsync( + string hfModelName, + string loraModelName, + string? xiApiKey = default, + string? hfToken = default, + string? baseModelName = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.LoraModelUploadIn + { + HfModelName = hfModelName, + HfToken = hfToken, + LoraModelName = loraModelName, + BaseModelName = baseModelName, + }; + + return await UploadLoraModelAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.g.cs new file mode 100644 index 00000000..943149f8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Create, manage, and query LoRA adapter models.
+ /// 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 LoRAAdaptersClient : global::DeepInfra.ILoRAAdaptersClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the LoRAAdaptersClient. + /// 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 LoRAAdaptersClient( + 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 LoRAAdaptersClient 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 LoRAAdaptersClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the LoRAAdaptersClient. + /// 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 LoRAAdaptersClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.LogsMetricsClient.DeploymentLogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.DeploymentLogsQuery.g.cs new file mode 100644 index 00000000..41b34856 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.DeploymentLogsQuery.g.cs @@ -0,0 +1,627 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LogsMetricsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeploymentLogsQuerySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeploymentLogsQuerySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeploymentLogsQuerySecurityRequirement0, + }; + partial void PrepareDeploymentLogsQueryArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? podName, + ref string? from, + ref string? to, + ref int? limit, + ref string? xiApiKey); + partial void PrepareDeploymentLogsQueryRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? podName, + string? from, + string? to, + int? limit, + string? xiApiKey); + partial void ProcessDeploymentLogsQueryResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeploymentLogsQueryResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deployment Logs Query
+ /// Query deployment logs.
+ /// * Without timestamps (from/to) returns last `limit` messages (in last month).
+ /// * With `from` only, returns first `limit` messages after `from` (inclusive).
+ /// * With `to` only, returns last `limit` messages before `to` (inclusive).
+ /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
+ /// * `from` and `to` should be no more than a month apart. + ///
+ /// + /// the deploy id to get the logs from + /// + /// + /// the pod name to get the logs from + /// + /// + /// start of period, in fractional seconds since unix epoch (inclusive) + /// + /// + /// end of period, in fractional seconds since unix epoch (exclusive) + /// + /// + /// how many items to return at most (default 100, in [1, 1000])
+ /// Default Value: 100 + /// + /// + /// 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 DeploymentLogsQueryAsync( + string deployId, + string? podName = default, + string? from = default, + string? to = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentLogsQueryAsResponseAsync( + deployId: deployId, + podName: podName, + from: from, + to: to, + limit: limit, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deployment Logs Query
+ /// Query deployment logs.
+ /// * Without timestamps (from/to) returns last `limit` messages (in last month).
+ /// * With `from` only, returns first `limit` messages after `from` (inclusive).
+ /// * With `to` only, returns last `limit` messages before `to` (inclusive).
+ /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
+ /// * `from` and `to` should be no more than a month apart. + ///
+ /// + /// the deploy id to get the logs from + /// + /// + /// the pod name to get the logs from + /// + /// + /// start of period, in fractional seconds since unix epoch (inclusive) + /// + /// + /// end of period, in fractional seconds since unix epoch (exclusive) + /// + /// + /// how many items to return at most (default 100, in [1, 1000])
+ /// Default Value: 100 + /// + /// + /// 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> DeploymentLogsQueryAsResponseAsync( + string deployId, + string? podName = default, + string? from = default, + string? to = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeploymentLogsQueryArguments( + httpClient: HttpClient, + deployId: ref deployId, + podName: ref podName, + from: ref from, + to: ref to, + limit: ref limit, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeploymentLogsQuerySecurityRequirements, + operationName: "DeploymentLogsQueryAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/deployment_logs/query", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("deploy_id", deployId) + .AddOptionalParameter("pod_name", podName) + .AddOptionalParameter("from", from) + .AddOptionalParameter("to", to) + .AddOptionalParameter("limit", limit?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeploymentLogsQueryRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + podName: podName, + from: from, + to: to, + limit: limit, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentLogsQuery", + methodName: "DeploymentLogsQueryAsync", + pathTemplate: "\"/v1/deployment_logs/query\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentLogsQuery", + methodName: "DeploymentLogsQueryAsync", + pathTemplate: "\"/v1/deployment_logs/query\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentLogsQuery", + methodName: "DeploymentLogsQueryAsync", + pathTemplate: "\"/v1/deployment_logs/query\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessDeploymentLogsQueryResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentLogsQuery", + methodName: "DeploymentLogsQueryAsync", + pathTemplate: "\"/v1/deployment_logs/query\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeploymentLogsQuery", + methodName: "DeploymentLogsQueryAsync", + pathTemplate: "\"/v1/deployment_logs/query\"", + httpMethod: "GET", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeploymentLogsQueryResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeploymentLogQueryOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.DeploymentLogQueryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.GetLiveMetrics.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.GetLiveMetrics.g.cs new file mode 100644 index 00000000..e5b30b94 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.GetLiveMetrics.g.cs @@ -0,0 +1,417 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LogsMetricsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetLiveMetricsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetLiveMetricsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetLiveMetricsSecurityRequirement0, + }; + partial void PrepareGetLiveMetricsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareGetLiveMetricsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessGetLiveMetricsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetLiveMetricsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Live Metrics
+ /// Get the latest values for the Live metrics section on the web front page. + ///
+ /// 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 GetLiveMetricsAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetLiveMetricsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Live Metrics
+ /// Get the latest values for the Live metrics section on the web front page. + ///
+ /// 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> GetLiveMetricsAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetLiveMetricsArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetLiveMetricsSecurityRequirements, + operationName: "GetLiveMetricsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/metrics/live", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetLiveMetricsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLiveMetrics", + methodName: "GetLiveMetricsAsync", + pathTemplate: "\"/v1/metrics/live\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLiveMetrics", + methodName: "GetLiveMetricsAsync", + pathTemplate: "\"/v1/metrics/live\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLiveMetrics", + methodName: "GetLiveMetricsAsync", + pathTemplate: "\"/v1/metrics/live\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetLiveMetricsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLiveMetrics", + methodName: "GetLiveMetricsAsync", + pathTemplate: "\"/v1/metrics/live\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLiveMetrics", + methodName: "GetLiveMetricsAsync", + pathTemplate: "\"/v1/metrics/live\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetLiveMetricsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.WebLiveMetricsOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.WebLiveMetricsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.GetRequestCosts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.GetRequestCosts.g.cs new file mode 100644 index 00000000..3b396137 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.GetRequestCosts.g.cs @@ -0,0 +1,512 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LogsMetricsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetRequestCostsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetRequestCostsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetRequestCostsSecurityRequirement0, + }; + partial void PrepareGetRequestCostsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.RequestCostQuery request); + partial void PrepareGetRequestCostsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.RequestCostQuery request); + partial void ProcessGetRequestCostsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetRequestCostsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Request Costs + /// + /// + /// + /// 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 GetRequestCostsAsync( + + global::DeepInfra.RequestCostQuery request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRequestCostsAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Request Costs + /// + /// + /// + /// 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> GetRequestCostsAsResponseAsync( + + global::DeepInfra.RequestCostQuery request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareGetRequestCostsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetRequestCostsSecurityRequirements, + operationName: "GetRequestCostsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/request-costs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetRequestCostsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetRequestCosts", + methodName: "GetRequestCostsAsync", + pathTemplate: "\"/v1/request-costs\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetRequestCosts", + methodName: "GetRequestCostsAsync", + pathTemplate: "\"/v1/request-costs\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetRequestCosts", + methodName: "GetRequestCostsAsync", + pathTemplate: "\"/v1/request-costs\"", + 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::DeepInfra.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); + ProcessGetRequestCostsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetRequestCosts", + methodName: "GetRequestCostsAsync", + pathTemplate: "\"/v1/request-costs\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetRequestCosts", + methodName: "GetRequestCostsAsync", + pathTemplate: "\"/v1/request-costs\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetRequestCostsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.RequestCostResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.RequestCostResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Get Request Costs + /// + /// + /// + /// 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 GetRequestCostsAsync( + global::System.Collections.Generic.IList requestIds, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.RequestCostQuery + { + RequestIds = requestIds, + }; + + return await GetRequestCostsAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.LogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.LogsQuery.g.cs new file mode 100644 index 00000000..82690f4c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.LogsQuery.g.cs @@ -0,0 +1,613 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LogsMetricsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_LogsQuerySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_LogsQuerySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_LogsQuerySecurityRequirement0, + }; + partial void PrepareLogsQueryArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? from, + ref string? to, + ref int? limit, + ref string? xiApiKey); + partial void PrepareLogsQueryRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? from, + string? to, + int? limit, + string? xiApiKey); + partial void ProcessLogsQueryResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessLogsQueryResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Logs Query
+ /// Query inference logs.
+ /// * Without timestamps (from/to) returns last `limit` messages (in last month).
+ /// * With `from` only, returns first `limit` messages after `from` (inclusive).
+ /// * With `to` only, returns last `limit` messages before `to` (inclusive).
+ /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
+ /// * `from` and `to` should be no more than a month apart. + ///
+ /// + /// the deploy id to get the logs from + /// + /// + /// start of period, in fractional seconds since unix epoch (inclusive) + /// + /// + /// end of period, in fractional seconds since unix epoch (exclusive) + /// + /// + /// how many items to return at most (default 100, in [1, 1000])
+ /// Default Value: 100 + /// + /// + /// 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 LogsQueryAsync( + string deployId, + string? from = default, + string? to = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await LogsQueryAsResponseAsync( + deployId: deployId, + from: from, + to: to, + limit: limit, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Logs Query
+ /// Query inference logs.
+ /// * Without timestamps (from/to) returns last `limit` messages (in last month).
+ /// * With `from` only, returns first `limit` messages after `from` (inclusive).
+ /// * With `to` only, returns last `limit` messages before `to` (inclusive).
+ /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
+ /// * `from` and `to` should be no more than a month apart. + ///
+ /// + /// the deploy id to get the logs from + /// + /// + /// start of period, in fractional seconds since unix epoch (inclusive) + /// + /// + /// end of period, in fractional seconds since unix epoch (exclusive) + /// + /// + /// how many items to return at most (default 100, in [1, 1000])
+ /// Default Value: 100 + /// + /// + /// 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> LogsQueryAsResponseAsync( + string deployId, + string? from = default, + string? to = default, + int? limit = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareLogsQueryArguments( + httpClient: HttpClient, + deployId: ref deployId, + from: ref from, + to: ref to, + limit: ref limit, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_LogsQuerySecurityRequirements, + operationName: "LogsQueryAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/logs/query", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("deploy_id", deployId) + .AddOptionalParameter("from", from) + .AddOptionalParameter("to", to) + .AddOptionalParameter("limit", limit?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareLogsQueryRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + from: from, + to: to, + limit: limit, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "LogsQuery", + methodName: "LogsQueryAsync", + pathTemplate: "\"/v1/logs/query\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "LogsQuery", + methodName: "LogsQueryAsync", + pathTemplate: "\"/v1/logs/query\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "LogsQuery", + methodName: "LogsQueryAsync", + pathTemplate: "\"/v1/logs/query\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessLogsQueryResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "LogsQuery", + methodName: "LogsQueryAsync", + pathTemplate: "\"/v1/logs/query\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "LogsQuery", + methodName: "LogsQueryAsync", + pathTemplate: "\"/v1/logs/query\"", + httpMethod: "GET", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessLogsQueryResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.LogQueryOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.LogQueryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.g.cs new file mode 100644 index 00000000..fdf4992e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Query inference logs, deployment logs, and usage metrics.
+ /// 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 LogsMetricsClient : global::DeepInfra.ILogsMetricsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the LogsMetricsClient. + /// 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 LogsMetricsClient( + 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 LogsMetricsClient 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 LogsMetricsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the LogsMetricsClient. + /// 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 LogsMetricsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.g.cs index 897628a3..9c90adf8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AccountEmailValuesV1MeEmailsGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.g.cs index cced60f7..0956566a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AccountGpuLimitV1MeGpuLimitGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.g.cs index 90a92acb..2ebd7c2d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AccountRateLimitV1MeRateLimitGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.g.cs index c1649d10..00777858 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class AccountUpdateDetailsV1MePatchResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.g.cs index ba332eec..f40fa831 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AccountUpdateDetailsV1MePatchXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs index 807b2d24..d6d70466 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs @@ -42,5 +42,6 @@ public AddFundsIn( public AddFundsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOut.Json.g.cs new file mode 100644 index 00000000..407866d0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOut.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AddFundsOut + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AddFundsOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AddFundsOut), + jsonSerializerContext) as global::DeepInfra.AddFundsOut; + } + + /// + /// 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::DeepInfra.AddFundsOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.AddFundsOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AddFundsOut; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOut.g.cs new file mode 100644 index 00000000..7287b13f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOut.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AddFundsOut + { + /// + /// Stripe-hosted invoice URL to complete payment. Non-null when no saved payment method is on file. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("checkout_url")] + public string? CheckoutUrl { 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. + /// + /// + /// Stripe-hosted invoice URL to complete payment. Non-null when no saved payment method is on file. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AddFundsOut( + string? checkoutUrl) + { + this.CheckoutUrl = checkoutUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public AddFundsOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOutCheckoutUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOutCheckoutUrl.Json.g.cs new file mode 100644 index 00000000..56e45836 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOutCheckoutUrl.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AddFundsOutCheckoutUrl + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AddFundsOutCheckoutUrl? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AddFundsOutCheckoutUrl), + jsonSerializerContext) as global::DeepInfra.AddFundsOutCheckoutUrl; + } + + /// + /// 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::DeepInfra.AddFundsOutCheckoutUrl? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.AddFundsOutCheckoutUrl), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AddFundsOutCheckoutUrl; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOutCheckoutUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOutCheckoutUrl.g.cs new file mode 100644 index 00000000..f9d158ea --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOutCheckoutUrl.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Stripe-hosted invoice URL to complete payment. Non-null when no saved payment method is on file. + /// + public sealed partial class AddFundsOutCheckoutUrl + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.Json.g.cs deleted file mode 100644 index 8530a926..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AddFundsPaymentFundsPostResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.AddFundsPaymentFundsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AddFundsPaymentFundsPostResponse), - jsonSerializerContext) as global::DeepInfra.AddFundsPaymentFundsPostResponse; - } - - /// - /// 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::DeepInfra.AddFundsPaymentFundsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.AddFundsPaymentFundsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AddFundsPaymentFundsPostResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.g.cs deleted file mode 100644 index 7b4a592a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AddFundsPaymentFundsPostResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs index 1dac37c2..6873bdf1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class AddFundsPaymentFundsPostSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceState.g.cs new file mode 100644 index 00000000..a89a4586 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceState.g.cs @@ -0,0 +1,81 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum AgentInstanceState + { + /// + /// + /// + Creating, + /// + /// + /// + Deleted, + /// + /// + /// + Failed, + /// + /// + /// + Running, + /// + /// + /// + Starting, + /// + /// + /// + Stopped, + /// + /// + /// + Stopping, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentInstanceStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentInstanceState value) + { + return value switch + { + AgentInstanceState.Creating => "creating", + AgentInstanceState.Deleted => "deleted", + AgentInstanceState.Failed => "failed", + AgentInstanceState.Running => "running", + AgentInstanceState.Starting => "starting", + AgentInstanceState.Stopped => "stopped", + AgentInstanceState.Stopping => "stopping", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentInstanceState? ToEnum(string value) + { + return value switch + { + "creating" => AgentInstanceState.Creating, + "deleted" => AgentInstanceState.Deleted, + "failed" => AgentInstanceState.Failed, + "running" => AgentInstanceState.Running, + "starting" => AgentInstanceState.Starting, + "stopped" => AgentInstanceState.Stopped, + "stopping" => AgentInstanceState.Stopping, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.g.cs index f26abc2d..62d4fc6f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesAnthropicV1MessagesPostAnthropicBet /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.g.cs index b0f7439a..9db375e9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesAnthropicV1MessagesPostAnthropicVer /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.g.cs index e2d97e40..782ee3e7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesAnthropicV1MessagesPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.g.cs index 4aff8291..38e84311 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesAnthropicV1MessagesPostXApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.g.cs index d8f498ad..0dfd2ed8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.g.cs index c7b3c386..a1ec65d9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesCountTokensAnthropicV1MessagesCount /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.g.cs index ab9f3484..eb829d4f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesCountTokensAnthropicV1MessagesCount /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.g.cs index cd1e6852..2bb23875 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.g.cs @@ -154,5 +154,6 @@ public AnthropicMessagesIn( public AnthropicMessagesIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.g.cs index f5e8aafe..657413f0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.g.cs index 90d01510..f1c14938 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInMessage /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.g.cs index 5c310f98..1fc1cacb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInMetadata /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.g.cs index 75310f07..cc54f9b2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInMetadata2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.g.cs index 08c0f2dc..e9374a32 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInStopSequences /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.g.cs index e3bb5f93..372a6e2f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInTemperature /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.g.cs index fa8f0067..c4264a53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInThinking /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.g.cs index c9faa950..f3389791 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInToolChoice /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.g.cs index 9782c779..dcb88873 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInToolChoice2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.g.cs index da4111cd..cb74da1e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInTools /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.g.cs index 69183ce5..a61e6866 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInTopK /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.g.cs index d91780ed..87683feb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInTopP /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.g.cs index a682bc4f..89152176 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.g.cs @@ -50,5 +50,18 @@ public AnthropicSystemContent( public AnthropicSystemContent() { } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static AnthropicSystemContent FromText(string text) + { + return new AnthropicSystemContent + { + Text = text, + }; + } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.g.cs index 8c801067..d59cd7d0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.g.cs @@ -41,5 +41,6 @@ public AnthropicThinkingConfig( public AnthropicThinkingConfig() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.g.cs index a88bca78..f3cf897b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.g.cs @@ -87,5 +87,6 @@ public AnthropicTokenCountRequest( public AnthropicTokenCountRequest() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.g.cs index d4e3cc59..ef04082f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicTokenCountRequestMessage /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.g.cs index dad0cc17..fdac1da8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicTokenCountRequestThinking /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.g.cs index 60e1a7f0..007cf53c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicTokenCountRequestToolChoice /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.g.cs index 2beeeb4d..94fb88b7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicTokenCountRequestToolChoice2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.g.cs index 47bf2e1e..d3eec50c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicTokenCountRequestTools /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.g.cs index c809bd10..dfdc2624 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.g.cs @@ -59,5 +59,6 @@ public AnthropicTool( public AnthropicTool() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.g.cs index d9ad7a8b..1832ae7e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicToolDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.g.cs index 9ab90616..8dc258db 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicToolInputSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.g.cs index eb7838b2..777e29bf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.g.cs @@ -81,5 +81,6 @@ public ApiToken( public ApiToken() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.g.cs index 14d823cc..94cc3524 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.g.cs @@ -14,5 +14,6 @@ public sealed partial class ApiTokenAllowedIps /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.g.cs index 94364ed7..7b3b63c8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.g.cs @@ -40,5 +40,6 @@ public ApiTokenIn( public ApiTokenIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.g.cs index cc96cf6d..9ee9dab2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.g.cs @@ -14,5 +14,6 @@ public sealed partial class ApiTokenTokenId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.g.cs index f8b5ccd2..f905cbe9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.g.cs @@ -80,5 +80,6 @@ public ApiTokenVercelExportIn( public ApiTokenVercelExportIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddress.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddress.Json.g.cs new file mode 100644 index 00000000..c4f2dd60 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddress.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddress + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddress? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddress), + jsonSerializerContext) as global::DeepInfra.BillingAddress; + } + + /// + /// 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::DeepInfra.BillingAddress? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.BillingAddress), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddress; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddress.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddress.g.cs new file mode 100644 index 00000000..d1cd681e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddress.g.cs @@ -0,0 +1,98 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddress + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("line1")] + public string? Line1 { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("line2")] + public string? Line2 { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("city")] + public string? City { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + public string? State { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("postal_code")] + public string? PostalCode { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("country")] + public string? Country { 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 BillingAddress( + string? name, + string? line1, + string? line2, + string? city, + string? state, + string? postalCode, + string? country) + { + this.Name = name; + this.Line1 = line1; + this.Line2 = line2; + this.City = city; + this.State = state; + this.PostalCode = postalCode; + this.Country = country; + } + + /// + /// Initializes a new instance of the class. + /// + public BillingAddress() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCity.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCity.Json.g.cs new file mode 100644 index 00000000..a5e04aa7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCity.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressCity + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressCity? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressCity), + jsonSerializerContext) as global::DeepInfra.BillingAddressCity; + } + + /// + /// 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::DeepInfra.BillingAddressCity? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.BillingAddressCity), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressCity; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCity.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCity.g.cs new file mode 100644 index 00000000..dbb4c4c5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCity.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressCity + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCountry.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCountry.Json.g.cs new file mode 100644 index 00000000..aa3fd6b5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCountry.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressCountry + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressCountry? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressCountry), + jsonSerializerContext) as global::DeepInfra.BillingAddressCountry; + } + + /// + /// 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::DeepInfra.BillingAddressCountry? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.BillingAddressCountry), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressCountry; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCountry.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCountry.g.cs new file mode 100644 index 00000000..e5acc435 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressCountry.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressCountry + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine1.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine1.Json.g.cs new file mode 100644 index 00000000..3fee53e4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine1.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressLine1 + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressLine1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressLine1), + jsonSerializerContext) as global::DeepInfra.BillingAddressLine1; + } + + /// + /// 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::DeepInfra.BillingAddressLine1? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.BillingAddressLine1), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressLine1; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine1.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine1.g.cs new file mode 100644 index 00000000..957b0bb0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine1.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressLine1 + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine2.Json.g.cs new file mode 100644 index 00000000..f4e248a7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressLine2 + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressLine2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressLine2), + jsonSerializerContext) as global::DeepInfra.BillingAddressLine2; + } + + /// + /// 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::DeepInfra.BillingAddressLine2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.BillingAddressLine2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressLine2; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine2.g.cs new file mode 100644 index 00000000..bb22350d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressLine2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressLine2 + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressName.Json.g.cs new file mode 100644 index 00000000..83adeb75 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressName.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressName + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressName? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressName), + jsonSerializerContext) as global::DeepInfra.BillingAddressName; + } + + /// + /// 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::DeepInfra.BillingAddressName? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.BillingAddressName), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressName; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressName.g.cs new file mode 100644 index 00000000..5d49d42d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressName.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressName + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressPostalCode.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressPostalCode.Json.g.cs new file mode 100644 index 00000000..0dad61d3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressPostalCode.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressPostalCode + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressPostalCode? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressPostalCode), + jsonSerializerContext) as global::DeepInfra.BillingAddressPostalCode; + } + + /// + /// 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::DeepInfra.BillingAddressPostalCode? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.BillingAddressPostalCode), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressPostalCode; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressPostalCode.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressPostalCode.g.cs new file mode 100644 index 00000000..fce0f487 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressPostalCode.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressPostalCode + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressState.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressState.Json.g.cs new file mode 100644 index 00000000..7d29c3d8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressState.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressState + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressState? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressState), + jsonSerializerContext) as global::DeepInfra.BillingAddressState; + } + + /// + /// 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::DeepInfra.BillingAddressState? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.BillingAddressState), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressState; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressState.g.cs new file mode 100644 index 00000000..eb813d45 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressState.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressState + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs index 22ea0d39..64f3ee63 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs @@ -40,5 +40,6 @@ public BillingPortalOut( public BillingPortalOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.g.cs index 71441528..11c7ed42 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class BillingPortalPaymentBillingPortalGetReturnUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs index fc747f81..825dc5a2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class BillingPortalPaymentBillingPortalGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.g.cs index a2c16cbc..b52bce2b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.g.cs @@ -60,5 +60,6 @@ public BodyCreateVoiceV1VoicesAddPost( public BodyCreateVoiceV1VoicesAddPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.g.cs index c09b6efd..92104e59 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.g.cs @@ -109,5 +109,6 @@ public BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost( public BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.g.cs index 4cebfbc2..ff327f2f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.g.cs index 1d16811c..f695f5eb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.g.cs index 8d793d09..ae744992 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.g.cs index bfd9426a..fa09713d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.g.cs index 86389fca..8fc14345 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.Json.g.cs deleted file mode 100644 index 18508302..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost; - } - - /// - /// 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.g.cs deleted file mode 100644 index b34c6a64..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.g.cs +++ /dev/null @@ -1,113 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] File { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("filename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Filename { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Model { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("language")] - public string? Language { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Default Value: json - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response_format")] - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? ResponseFormat { get; set; } - - /// - /// Default Value: 0 - /// - [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public double? Temperature { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("timestamp_granularities")] - public global::System.Collections.Generic.IList? TimestampGranularities { 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. - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost( - byte[] file, - string filename, - string model, - string? language, - string? prompt, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? responseFormat, - double? temperature, - global::System.Collections.Generic.IList? timestampGranularities) - { - this.File = file ?? throw new global::System.ArgumentNullException(nameof(file)); - this.Filename = filename ?? throw new global::System.ArgumentNullException(nameof(filename)); - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - this.Language = language; - this.Prompt = prompt; - this.ResponseFormat = responseFormat; - this.Temperature = temperature; - this.TimestampGranularities = timestampGranularities; - } - - /// - /// Initializes a new instance of the class. - /// - public BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.Json.g.cs deleted file mode 100644 index d515a499..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage; - } - - /// - /// 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.g.cs deleted file mode 100644 index 50c77eed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.Json.g.cs deleted file mode 100644 index 983c3700..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt; - } - - /// - /// 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.g.cs deleted file mode 100644 index 5ed02d8f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.Json.g.cs deleted file mode 100644 index c0bcf406..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat; - } - - /// - /// 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.g.cs deleted file mode 100644 index b9cf6773..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: json - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs deleted file mode 100644 index 49fdb84c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public enum BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2 - { - /// - /// - /// - Json, - /// - /// - /// - Srt, - /// - /// - /// - Text, - /// - /// - /// - VerboseJson, - /// - /// - /// - Vtt, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Extensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2 value) - { - return value switch - { - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Json => "json", - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Srt => "srt", - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Text => "text", - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.VerboseJson => "verbose_json", - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Vtt => "vtt", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? ToEnum(string value) - { - return value switch - { - "json" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Json, - "srt" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Srt, - "text" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Text, - "verbose_json" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.VerboseJson, - "vtt" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Vtt, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.Json.g.cs deleted file mode 100644 index 305d7089..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature; - } - - /// - /// 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.g.cs deleted file mode 100644 index d7d5fb3b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: 0 - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.Json.g.cs deleted file mode 100644 index 8c6be9d7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities; - } - - /// - /// 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.g.cs deleted file mode 100644 index 3fd8ffb8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs deleted file mode 100644 index a8cc1eb5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public enum BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item - { - /// - /// - /// - Segment, - /// - /// - /// - Word, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item value) - { - return value switch - { - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.Segment => "segment", - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.Word => "word", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item? ToEnum(string value) - { - return value switch - { - "segment" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.Segment, - "word" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.Word, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.g.cs index d05def67..67bf891c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.g.cs @@ -91,5 +91,6 @@ public BodyOpenaiAudioTranslationsV1AudioTranslationsPost( public BodyOpenaiAudioTranslationsV1AudioTranslationsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.g.cs index d57b2e35..5171828f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPostPr /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.g.cs index 091a4e58..15d0105b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPostRe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.g.cs index 0b2160b9..b4ba6c10 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPostTe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.Json.g.cs deleted file mode 100644 index 82d90dc3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost; - } - - /// - /// 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.g.cs deleted file mode 100644 index 630aafe5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.g.cs +++ /dev/null @@ -1,95 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] File { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("filename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Filename { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Model { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Default Value: json - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response_format")] - public global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? ResponseFormat { get; set; } - - /// - /// Default Value: 0 - /// - [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public double? Temperature { 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. - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost( - byte[] file, - string filename, - string model, - string? prompt, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? responseFormat, - double? temperature) - { - this.File = file ?? throw new global::System.ArgumentNullException(nameof(file)); - this.Filename = filename ?? throw new global::System.ArgumentNullException(nameof(filename)); - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - this.Prompt = prompt; - this.ResponseFormat = responseFormat; - this.Temperature = temperature; - } - - /// - /// Initializes a new instance of the class. - /// - public BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.Json.g.cs deleted file mode 100644 index 592f66fe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt; - } - - /// - /// 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.g.cs deleted file mode 100644 index f0a399de..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.Json.g.cs deleted file mode 100644 index 4f231945..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat; - } - - /// - /// 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.g.cs deleted file mode 100644 index 8cfba36a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: json - /// - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs deleted file mode 100644 index 07f27fe7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public enum BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2 - { - /// - /// - /// - Json, - /// - /// - /// - Srt, - /// - /// - /// - Text, - /// - /// - /// - VerboseJson, - /// - /// - /// - Vtt, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Extensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2 value) - { - return value switch - { - BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Json => "json", - BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Srt => "srt", - BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Text => "text", - BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.VerboseJson => "verbose_json", - BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Vtt => "vtt", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? ToEnum(string value) - { - return value switch - { - "json" => BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Json, - "srt" => BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Srt, - "text" => BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Text, - "verbose_json" => BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.VerboseJson, - "vtt" => BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Vtt, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.Json.g.cs deleted file mode 100644 index c26fa515..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature; - } - - /// - /// 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.g.cs deleted file mode 100644 index d46bf9a4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: 0 - /// - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.g.cs index c7c7acb7..c5f32d13 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.g.cs @@ -50,5 +50,6 @@ public BodyOpenaiFilesV1FilesPost( public BodyOpenaiFilesV1FilesPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.Json.g.cs deleted file mode 100644 index 10447d5e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiFilesV1OpenaiFilesPost - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost; - } - - /// - /// 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::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.g.cs deleted file mode 100644 index b4b26c67..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.g.cs +++ /dev/null @@ -1,54 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiFilesV1OpenaiFilesPost - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("purpose")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Purpose { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList File { 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 BodyOpenaiFilesV1OpenaiFilesPost( - string purpose, - global::System.Collections.Generic.IList file) - { - this.Purpose = purpose ?? throw new global::System.ArgumentNullException(nameof(purpose)); - this.File = file ?? throw new global::System.ArgumentNullException(nameof(file)); - } - - /// - /// Initializes a new instance of the class. - /// - public BodyOpenaiFilesV1OpenaiFilesPost() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.g.cs index e4a3e97b..da90f3c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.g.cs @@ -79,5 +79,6 @@ public BodyOpenaiImagesEditsV1ImagesEditsPost( public BodyOpenaiImagesEditsV1ImagesEditsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.g.cs index f0f5dbbf..a316417b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiImagesEditsV1ImagesEditsPostInp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.Json.g.cs deleted file mode 100644 index 3b89a929..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiImagesEditsV1OpenaiImagesEditsPost - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost; - } - - /// - /// 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::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.g.cs deleted file mode 100644 index 13564da4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.g.cs +++ /dev/null @@ -1,83 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiImagesEditsV1OpenaiImagesEditsPost - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("inp")] - public global::DeepInfra.OpenAIImagesEditsIn? Inp { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Model { 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 BodyOpenaiImagesEditsV1OpenaiImagesEditsPost( - byte[] image, - string imagename, - string prompt, - string model, - global::DeepInfra.OpenAIImagesEditsIn? inp) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Inp = inp; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - } - - /// - /// Initializes a new instance of the class. - /// - public BodyOpenaiImagesEditsV1OpenaiImagesEditsPost() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.Json.g.cs deleted file mode 100644 index de1bb885..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp; - } - - /// - /// 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::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.g.cs deleted file mode 100644 index 1e7d902d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.g.cs index 3b42d8dd..b8f9963f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.g.cs @@ -69,5 +69,6 @@ public BodyOpenaiImagesVariationsV1ImagesVariationsPost( public BodyOpenaiImagesVariationsV1ImagesVariationsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.g.cs index a9a52231..bc00ac08 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiImagesVariationsV1ImagesVariationsPostInp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.Json.g.cs deleted file mode 100644 index 1ada112b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost; - } - - /// - /// 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::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.g.cs deleted file mode 100644 index d47dd3bb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.g.cs +++ /dev/null @@ -1,73 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("inp")] - public global::DeepInfra.OpenAIImagesVariationsIn? Inp { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Model { 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 BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost( - byte[] image, - string imagename, - string model, - global::DeepInfra.OpenAIImagesVariationsIn? inp) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Inp = inp; - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - } - - /// - /// Initializes a new instance of the class. - /// - public BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.Json.g.cs deleted file mode 100644 index 63c6fee3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp; - } - - /// - /// 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::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.g.cs deleted file mode 100644 index 0c56d3e7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.g.cs index bf273e21..97d0bcba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.g.cs @@ -50,5 +50,6 @@ public BodyUpdateVoiceV1VoicesVoiceIdEditPost( public BodyUpdateVoiceV1VoicesVoiceIdEditPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.g.cs index 42277b8a..130245c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.g.cs @@ -97,5 +97,6 @@ public ChatCompletionAssistantMessage( public ChatCompletionAssistantMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl.g.cs index c62fcfef..fa11ad2e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionAssistantMessageCacheControl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.g.cs index 66c9ad76..a2e43097 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionAssistantMessageCacheControl2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.g.cs index 4f925db1..c19efb03 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionAssistantMessageName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.g.cs index e17d7fed..5fd59d9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionAssistantMessageReasoningContent /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.g.cs index 78b41ed8..03e71494 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionAssistantMessageToolCalls /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.cs index a7c05e81..5a4dde2e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.cs @@ -50,5 +50,18 @@ public ChatCompletionContentPartAudio( public ChatCompletionContentPartAudio() { } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static ChatCompletionContentPartAudio FromInputAudio(global::DeepInfra.InputAudio inputAudio) + { + return new ChatCompletionContentPartAudio + { + InputAudio = inputAudio, + }; + } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.g.cs index 7247deb2..e0592ac7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.g.cs @@ -50,5 +50,18 @@ public ChatCompletionContentPartImage( public ChatCompletionContentPartImage() { } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static ChatCompletionContentPartImage FromImageUrl(global::DeepInfra.ImageURL imageUrl) + { + return new ChatCompletionContentPartImage + { + ImageUrl = imageUrl, + }; + } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.g.cs index cc286222..f5389fad 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.g.cs @@ -50,5 +50,18 @@ public ChatCompletionContentPartText( public ChatCompletionContentPartText() { } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static ChatCompletionContentPartText FromText(string text) + { + return new ChatCompletionContentPartText + { + Text = text, + }; + } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.Json.g.cs new file mode 100644 index 00000000..fa0564ef --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ChatCompletionContentPartVideo + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionContentPartVideo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ChatCompletionContentPartVideo), + jsonSerializerContext) as global::DeepInfra.ChatCompletionContentPartVideo; + } + + /// + /// 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::DeepInfra.ChatCompletionContentPartVideo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ChatCompletionContentPartVideo), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionContentPartVideo; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.g.cs new file mode 100644 index 00000000..845933df --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.g.cs @@ -0,0 +1,67 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ChatCompletionContentPartVideo + { + /// + /// + /// + /// "video_url" + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string Type { get; set; } = "video_url"; + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("video_url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::DeepInfra.VideoURL VideoUrl { 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 ChatCompletionContentPartVideo( + global::DeepInfra.VideoURL videoUrl, + string type = "video_url") + { + this.Type = type; + this.VideoUrl = videoUrl ?? throw new global::System.ArgumentNullException(nameof(videoUrl)); + } + + /// + /// Initializes a new instance of the class. + /// + public ChatCompletionContentPartVideo() + { + } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static ChatCompletionContentPartVideo FromVideoUrl(global::DeepInfra.VideoURL videoUrl) + { + return new ChatCompletionContentPartVideo + { + VideoUrl = videoUrl, + }; + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.g.cs index d9a9f0fa..ec52b4c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.g.cs @@ -66,5 +66,6 @@ public ChatCompletionMessageToolCall( public ChatCompletionMessageToolCall() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.g.cs index edf202da..80ab522d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.g.cs @@ -76,5 +76,6 @@ public ChatCompletionSystemMessage( public ChatCompletionSystemMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl.g.cs index c6f38aee..2075359c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionSystemMessageCacheControl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.g.cs index 4bc8ace1..26926d6b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionSystemMessageCacheControl2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.g.cs index b5c099f4..3f1bee17 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionSystemMessageName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.g.cs index 0527c62e..b7e560ba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.g.cs @@ -77,5 +77,6 @@ public ChatCompletionToolMessage( public ChatCompletionToolMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl.g.cs index c60c132d..b17ceb3f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionToolMessageCacheControl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.g.cs index e2cf6f1d..d3a7d1ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionToolMessageCacheControl2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.cs index 131c961a..f3226008 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.cs @@ -25,9 +25,9 @@ public sealed partial class ChatCompletionUserMessage /// the message content /// [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>>))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>>))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.AnyOf>> Content { get; set; } + public required global::DeepInfra.AnyOf>> Content { get; set; } /// /// @@ -59,7 +59,7 @@ public sealed partial class ChatCompletionUserMessage [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ChatCompletionUserMessage( - global::DeepInfra.AnyOf>> content, + global::DeepInfra.AnyOf>> content, object? cacheControl, string? role, string? name) @@ -76,5 +76,6 @@ public ChatCompletionUserMessage( public ChatCompletionUserMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl.g.cs index 3afacb62..4d67f351 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionUserMessageCacheControl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.g.cs index f3bcbc53..2611b763 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionUserMessageCacheControl2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.g.cs index 0eeac062..40a06862 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionUserMessageName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs index ee63522a..e812e25e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs @@ -52,5 +52,6 @@ public ChatReasoningSettings( public ChatReasoningSettings() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.g.cs index b61d43db..b06a484b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatReasoningSettingsEffort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort2.g.cs index 9b47859d..559f9a3a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort2.g.cs @@ -20,6 +20,10 @@ public enum ChatReasoningSettingsEffort2 /// /// Medium, + /// + /// + /// + Xhigh, } /// @@ -37,6 +41,7 @@ public static string ToValueString(this ChatReasoningSettingsEffort2 value) ChatReasoningSettingsEffort2.High => "high", ChatReasoningSettingsEffort2.Low => "low", ChatReasoningSettingsEffort2.Medium => "medium", + ChatReasoningSettingsEffort2.Xhigh => "xhigh", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -50,6 +55,7 @@ public static string ToValueString(this ChatReasoningSettingsEffort2 value) "high" => ChatReasoningSettingsEffort2.High, "low" => ChatReasoningSettingsEffort2.Low, "medium" => ChatReasoningSettingsEffort2.Medium, + "xhigh" => ChatReasoningSettingsEffort2.Xhigh, _ => null, }; } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.g.cs index 740344b9..eb977679 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatReasoningSettingsEnabled /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.g.cs index caa4ca08..2a097261 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.g.cs @@ -62,5 +62,6 @@ public ChatTools( public ChatTools() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.g.cs index 19435e8c..92465d4e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatToolsCacheControl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.g.cs index 6e6926d4..c8fa685d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatToolsCacheControl2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs index 64736436..f8f50d95 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs @@ -94,6 +94,12 @@ public sealed partial class Checklist [global::System.Text.Json.Serialization.JsonPropertyName("topup_failed")] public bool? TopupFailed { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("billing_type")] + public string? BillingType { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -141,6 +147,7 @@ public sealed partial class Checklist /// /// Default Value: false /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -158,7 +165,8 @@ public Checklist( bool? topup, int? topupAmount, int? topupThreshold, - bool? topupFailed) + bool? topupFailed, + string? billingType) { this.Email = email; this.BillingAddress = billingAddress; @@ -174,6 +182,7 @@ public Checklist( this.TopupAmount = topupAmount; this.TopupThreshold = topupThreshold; this.TopupFailed = topupFailed; + this.BillingType = billingType; } /// @@ -182,5 +191,6 @@ public Checklist( public Checklist() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingType.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingType.Json.g.cs new file mode 100644 index 00000000..80ac79c8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingType.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ChecklistBillingType + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ChecklistBillingType? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ChecklistBillingType), + jsonSerializerContext) as global::DeepInfra.ChecklistBillingType; + } + + /// + /// 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::DeepInfra.ChecklistBillingType? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ChecklistBillingType), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChecklistBillingType; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingType.g.cs new file mode 100644 index 00000000..d61e2616 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingType.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ChecklistBillingType + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.g.cs index dd69631a..762df4ef 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChecklistLimit /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.g.cs index 199de338..aca17332 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChecklistSuspendReason /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.g.cs index 14eb0613..7b3a93f4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class CliVersionCliVersionGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.g.cs index 92dbb3e4..f2355032 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.g.cs @@ -14,6 +14,12 @@ public sealed partial class CompletionMultiModalData [global::System.Text.Json.Serialization.JsonPropertyName("image")] public global::System.Collections.Generic.IList? Image { get; set; } + /// + /// List of videos as base64 data URIs (e.g. 'data:video/mp4;base64,...'). Each video must correspond to a placeholder token in the prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("video")] + public global::System.Collections.Generic.IList? Video { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -26,13 +32,18 @@ public sealed partial class CompletionMultiModalData /// /// List of images as base64 data URIs (e.g. 'data:image/png;base64,...'). Each image must correspond to a placeholder token in the prompt. /// + /// + /// List of videos as base64 data URIs (e.g. 'data:video/mp4;base64,...'). Each video must correspond to a placeholder token in the prompt. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CompletionMultiModalData( - global::System.Collections.Generic.IList? image) + global::System.Collections.Generic.IList? image, + global::System.Collections.Generic.IList? video) { this.Image = image; + this.Video = video; } /// @@ -41,5 +52,6 @@ public CompletionMultiModalData( public CompletionMultiModalData() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs index 71d9550b..3dd0d847 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs @@ -41,5 +41,6 @@ public ConfigIn( public ConfigIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.g.cs index f1d4bee0..08c2c242 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.g.cs @@ -14,5 +14,6 @@ public sealed partial class ConfigInLimit /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs index e0bc2bf4..d27024bc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs @@ -42,5 +42,6 @@ public ConfigOut( public ConfigOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.g.cs index 5fabca76..c52c813d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.g.cs @@ -138,5 +138,6 @@ public ContainerRentalOut( public ContainerRentalOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.g.cs index 4726eb7b..63b2969c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalOutFailReason /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.g.cs index b70981b0..a4c5683b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalOutIp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.g.cs index 123f8075..480cdee7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalOutStopTs /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.g.cs index a0c5dafa..82c1c0e0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.g.cs @@ -78,5 +78,6 @@ public ContainerRentalStartIn( public ContainerRentalStartIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.g.cs index c5b41601..e2d94bba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.g.cs @@ -42,5 +42,6 @@ public ContainerRentalStartOut( public ContainerRentalStartOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.g.cs index e19fe07e..e1183e0a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.g.cs @@ -42,5 +42,6 @@ public ContainerRentalUpdateIn( public ContainerRentalUpdateIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.g.cs index 9457513c..6ba679ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsDeleteV1ContainersContainerIdDeleteR /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.g.cs index d6848898..89dc3c50 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsDeleteV1ContainersContainerIdDeleteX /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.g.cs index 75f44e98..e8fd82d6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsGetParamsV1ContainersParamsGetRespon /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.g.cs index 9019f2be..c9b36ca4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsGetParamsV1ContainersParamsGetXiApiK /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.g.cs index 74075bbc..669a1e9d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsGetV1ContainersContainerIdGetXiApiKe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.g.cs index cadb3b19..a1cca500 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsListV1ContainersGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.g.cs index 838477fb..18547a9d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsStartV1ContainersPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.g.cs index 4b994d95..29fd55fa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsUpdateV1ContainersContainerIdPatchRe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.g.cs index 4c148664..a1d625f0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsUpdateV1ContainersContainerIdPatchXi /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.g.cs index 52ec95f8..b56f40ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateApiTokenV1ApiTokensPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.g.cs index 6f830e44..6b7a2316 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.g.cs @@ -79,5 +79,6 @@ public CreateLoraApiRequest( public CreateLoraApiRequest() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.g.cs index a7347f5f..201448ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateLoraApiRequestDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.g.cs index cd1964c1..e0f607d6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateLoraV1LoraCreatePostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.g.cs index 330789d2..3f94668f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateOpenaiBatchV1BatchesPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.Json.g.cs deleted file mode 100644 index 8fb80c0c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey; - } - - /// - /// 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::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.g.cs deleted file mode 100644 index b880188a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.g.cs index b4e4da5f..d1cbc813 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateScopedJwtV1ScopedJwtPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.g.cs index de7715be..41efcd77 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateSshKeyV1SshKeysPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.g.cs index 600643f6..89acb12f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateVoiceV1VoicesAddPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.g.cs index 7a4ae3cc..cbe006e6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.g.cs @@ -42,5 +42,6 @@ public DeepError( public DeepError() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs index 1c9ef521..482524d5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs @@ -127,5 +127,6 @@ public DeepStartApplicationIn( public DeepStartApplicationIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.g.cs index 4dcb93a7..c3fbf1bc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepStartApplicationInDeal /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.g.cs index b77c6532..4e4dc167 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepStartApplicationInUid /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs index 7795beb7..e02469a6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs @@ -136,5 +136,6 @@ public DeepStartApplicationOut( public DeepStartApplicationOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.g.cs index 694f7e00..144cfcc2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepStartApplicationOutDeal /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.g.cs index d97c4fc9..de1d17f6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepStartApplicationOutEmail /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.g.cs index 2619412d..80cf2530 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepStartApplicationOutUid /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs index 182af052..604a6ff2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepstartApplyPaymentDeepstartApplicationPostSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.g.cs index 0cf20c76..6c08861d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteAccountV1MeDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.g.cs index 48877b1c..8ee458d8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteApiTokenV1ApiTokensApiTokenDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.g.cs index 67c82c60..752c330f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.g.cs index bab1a15d..9ce44fda 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteLoraModelLoraModelLoraModelNameDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.g.cs index c67d70d8..16e0b163 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.g.cs index 97fd6215..f5c6edaa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteLoraV1LoraLoraNameDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.g.cs index 548a55d9..0973840c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteLoraV1LoraLoraNameDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.g.cs index 1c28b2ba..20f8f3b1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.g.cs index e5958d5a..c5cc048c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.g.cs index f17d7da7..1de5ecad 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteVoiceV1VoicesVoiceIdDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.g.cs index bf5abcb2..97b8fc81 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.g.cs index b762f323..7660ca1c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployCreateHfDeployHfPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.g.cs index c757eb36..8e489382 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployCreateLlmDeployLlmPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.g.cs index eeeaa48a..7424b00b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployCreateV1DeployPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.g.cs index 2129ce5b..f90adafe 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.g.cs @@ -42,5 +42,6 @@ public DeployDelete( public DeployDelete() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.g.cs index 8eb4d038..4fb5d76b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployDeleteDeployDeployIdDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.g.cs index 2b1cf707..73f2c9a1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployDetailedStatsDeployDeployIdStats2GetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.g.cs index aadc8a0a..c8ac50ae 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.g.cs @@ -42,5 +42,6 @@ public DeployGPUAvailability( public DeployGPUAvailability() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.g.cs index ae38fd34..3a1920b8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiAp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.g.cs index bd0d8125..fcad7b53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.g.cs @@ -50,5 +50,6 @@ public DeployInstances( public DeployInstances() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.g.cs index 5c271ec7..3ccc1046 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.g.cs @@ -78,5 +78,6 @@ public DeployLLMConfig( public DeployLLMConfig() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfigWeights.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfigWeights.g.cs index c01bbaa3..8ac46e16 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfigWeights.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfigWeights.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMConfigWeights /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.g.cs index d50dad61..eb19c381 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.g.cs @@ -132,5 +132,6 @@ public DeployLLMIn( public DeployLLMIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.g.cs index a78344b6..71b51773 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMInBaseModel /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.g.cs index 47e596e5..2eaad5f7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMInContainerImage /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.g.cs index 25800eac..49dedd4d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMInExtraArgs /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.g.cs index 01f1bb07..f7aef21a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMInHf /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.g.cs index 25921b1b..adcf3dcb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMInSettings /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.g.cs index 049388c2..447fd070 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.g.cs @@ -40,5 +40,6 @@ public DeployLLMUpdateIn( public DeployLLMUpdateIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.g.cs index a1d1b3ea..443d1615 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployListDeployListGetStatus /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.g.cs index 4462e019..92ade622 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployListDeployListGetStatus2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.g.cs index c7cb6295..6db9c2dc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployListDeployListGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.g.cs index ffcecc2b..d02477ea 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployListDeployListGetXiApiKey2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..2fc300f1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey; + } + + /// + /// 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::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.g.cs new file mode 100644 index 00000000..430d4547 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.g.cs index c98ce302..b36b2e5f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.g.cs @@ -67,5 +67,6 @@ public DeployModelIn( public DeployModelIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.g.cs index 4d6373b4..ff4debf1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployModelInVersion /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.g.cs index 4cc0bdab..cb730d95 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.g.cs @@ -42,5 +42,6 @@ public DeployResult( public DeployResult() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.g.cs index 0db29134..87c0190d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployStartDeployDeployIdStartPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.g.cs index aea696c3..d2df8be6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployStatsDeployDeployIdStatsGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.g.cs index b3214252..6ed69478 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployStatusDeployDeployIdGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.g.cs index 76672cc6..dcaa6168 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.g.cs @@ -42,5 +42,6 @@ public DeployStatusOut( public DeployStatusOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.g.cs index 7d50f87e..b7a92da5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployStopDeployDeployIdStopPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.g.cs index 3375f154..d8c984ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployUpdateDeployDeployIdPutXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.g.cs index 3ea8a879..7ed03c57 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.g.cs @@ -12,7 +12,7 @@ public sealed partial class DeploymentLogQueryOut /// mapping of pod names to log lines ordered by increasing timestamp /// [global::System.Text.Json.Serialization.JsonPropertyName("entries")] - public global::System.Collections.Generic.Dictionary>? Entries { get; set; } + public global::System.Collections.Generic.Dictionary>>? Entries { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -30,7 +30,7 @@ public sealed partial class DeploymentLogQueryOut [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public DeploymentLogQueryOut( - global::System.Collections.Generic.Dictionary>? entries) + global::System.Collections.Generic.Dictionary>>? entries) { this.Entries = entries; } @@ -41,5 +41,6 @@ public DeploymentLogQueryOut( public DeploymentLogQueryOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOutEntries.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOutEntries.g.cs index c8625ed8..3512ab0f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOutEntries.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOutEntries.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentLogQueryOutEntries /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.g.cs index 14cefcbf..06af47ef 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetFrom /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.g.cs index d15081e1..e59ed00f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetPodName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.g.cs index 2516b034..16190bd6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.g.cs index 0264d8c1..f3aa8688 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.g.cs index 2ddb3531..1885d5b1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.g.cs @@ -54,5 +54,6 @@ public DeploymentMainStatsOut( public DeploymentMainStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.g.cs index eff1b19a..8e64c0ea 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.g.cs @@ -171,5 +171,6 @@ public DeploymentOut( public DeploymentOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutConfig.g.cs index becd55da..4d8a2a96 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutConfig.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutConfig.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentOutConfig /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutInstances.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutInstances.g.cs index 30367476..bc97e8d6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutInstances.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutInstances.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentOutInstances /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutSettings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutSettings.g.cs index 5485426d..4ce7d4ac 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutSettings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutSettings.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentOutSettings /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.g.cs index 38954a2e..7b766fe8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentStatsDeployStatsGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.g.cs index 75cc6b34..c596be1a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.g.cs @@ -138,5 +138,6 @@ public DeploymentStatsOut( public DeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.g.cs index 5e94f173..fdb52e13 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.g.cs @@ -63,5 +63,6 @@ public DetailedDeploymentStatsOut( public DetailedDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutEmbeddings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutEmbeddings.g.cs index 5017e834..9b17ae4b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutEmbeddings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutEmbeddings.g.cs @@ -14,5 +14,6 @@ public sealed partial class DetailedDeploymentStatsOutEmbeddings /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutLlm.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutLlm.g.cs index 0bc1a286..69b6bf39 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutLlm.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutLlm.g.cs @@ -14,5 +14,6 @@ public sealed partial class DetailedDeploymentStatsOutLlm /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutTime.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutTime.g.cs index a1dff3b3..e6919a32 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutTime.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutTime.g.cs @@ -14,5 +14,6 @@ public sealed partial class DetailedDeploymentStatsOutTime /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs index a67b53e9..8ba43702 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs @@ -51,5 +51,6 @@ public DiscountMeta( public DiscountMeta() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.g.cs index 15a36059..3ec31f56 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class DiscountMetaDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.g.cs index 52d39002..a6f6fac7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.g.cs @@ -42,5 +42,6 @@ public DisplayNameIn( public DisplayNameIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.g.cs index e2bdf2d7..42ef24b2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.g.cs @@ -80,5 +80,6 @@ public ElevenLabsTextToSpeechIn( public ElevenLabsTextToSpeechIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.g.cs index 24743f81..a8b77e6e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.g.cs @@ -14,5 +14,6 @@ public sealed partial class ElevenLabsTextToSpeechInLanguageCode /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.g.cs index 48851bc8..2cf74744 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.g.cs @@ -42,5 +42,6 @@ public EmailsOut( public EmailsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.g.cs index 4fe855d0..ab573374 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.g.cs @@ -102,5 +102,6 @@ public EmbeddingsDeploymentStatsOut( public EmbeddingsDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.g.cs index c9c94464..e2bf43e6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ExportApiTokenToVercelV1ApiTokensApiTokenVercelExpor /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.g.cs index 06717c23..5366433d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ExportApiTokenToVercelV1ApiTokensApiTokenVercelExpor /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.g.cs index 3d550485..8f00fbc3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.g.cs @@ -79,5 +79,6 @@ public FAQEntryOut( public FAQEntryOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.g.cs index 97a10144..758b5069 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.g.cs @@ -53,5 +53,6 @@ public FeedbackIn( public FeedbackIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.g.cs index 7d199dee..f7e15f67 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.g.cs @@ -14,5 +14,6 @@ public sealed partial class FeedbackInContactEmail /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.g.cs index bccd09bb..bb5d70e1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.g.cs @@ -54,5 +54,6 @@ public Function( public Function() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.g.cs index 005d5323..d1ca7efd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.g.cs @@ -58,5 +58,6 @@ public FunctionDefinition( public FunctionDefinition() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.g.cs index 8c8e6af2..930e44e6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class FunctionDefinitionDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.g.cs index 23cec2da..55cda535 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.g.cs @@ -14,5 +14,6 @@ public sealed partial class FunctionDefinitionParameters /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.g.cs index fb9f5221..c13780f2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.g.cs @@ -14,5 +14,6 @@ public sealed partial class FunctionDefinitionParameters2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.g.cs index 19c309d0..d6c5a465 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.g.cs @@ -71,5 +71,6 @@ public GPUAvailabilityInfo( public GPUAvailabilityInfo() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.g.cs index 9489f8a2..f6ae3723 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetApiTokenV1ApiTokensApiTokenGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.g.cs index 0e59736f..508ae085 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetApiTokensV1ApiTokensGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs index b14b6109..598c6cac 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetChecklistPaymentChecklistGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs index 10f7252f..b3fc43a3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetConfigPaymentConfigGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.g.cs index a9c32ad5..f54b989f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetHardwareV2HardwareGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.g.cs index 101a6c12..81db7178 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetLoraStatusV1LoraLoraNameStatusGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.g.cs index 61b95933..aa2ec160 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetLoraStatusV1LoraLoraNameStatusGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.g.cs index 00e2c923..a2216619 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetLoraV1LoraLoraNameGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.g.cs index 71adacfc..507f0172 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetLoraV1LoraLoraNameGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.g.cs index d1ee567c..fae0c5db 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetModelLorasV1ModelModelNameLorasGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.g.cs index 527437d0..6a2b2997 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetModelLorasV1ModelModelNameLorasGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.g.cs index ab9febfa..b092d835 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetRequestCostsV1RequestCostsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.g.cs index d1a5112c..2c21e436 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetSshKeysV1SshKeysGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs index 0a824f61..0f939b75 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetUserLorasV1UserLorasGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.g.cs index 1ec8e24c..c1fd0e5c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetUserLorasV1UserLorasGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.g.cs index 7c3cf4cd..1b5ba325 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetVoiceV1VoicesVoiceIdGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.g.cs index a2b435ea..09e8a5e8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.g.cs @@ -39,5 +39,6 @@ public GetVoicesOut( public GetVoicesOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.g.cs index b22026d3..85e4393d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetVoicesV1VoicesGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.g.cs index dc02bbe8..b8e13d13 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubCliLoginGithubCliLoginGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.g.cs index e064de2c..7ec920d4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubLoginGithubLoginGetDeal /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.g.cs index 3e032fd7..75008089 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubLoginGithubLoginGetLoginId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.g.cs index e914a01f..83b8729e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubLoginGithubLoginGetOrigin /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.g.cs index 84a7eb6f..4bfe8e40 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubLoginGithubLoginGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.g.cs index aab03976..ed359998 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubLoginGithubLoginGetTiToken /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.g.cs index 440cebfa..08a20bc9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.g.cs @@ -53,5 +53,6 @@ public GpuLimitOut( public GpuLimitOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.g.cs index 67d854a1..dcd72eee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.g.cs @@ -14,5 +14,6 @@ public sealed partial class GpuLimitOutLimits /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.g.cs index c7c6cb88..a18fcb7e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.g.cs @@ -14,5 +14,6 @@ public sealed partial class GpuLimitOutPendingRequests /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.g.cs index 8d4af715..413802f8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.g.cs @@ -14,5 +14,6 @@ public sealed partial class GpuLimitOutPendingRequests2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.g.cs index 24075f93..0c81707c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.g.cs @@ -60,5 +60,6 @@ public GpuLimitRequestIn( public GpuLimitRequestIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.g.cs index 4260e924..fd2d6c3d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.g.cs @@ -53,5 +53,6 @@ public HFModel( public HFModel() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.g.cs index 4506187e..3e00a8ec 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.g.cs @@ -14,5 +14,6 @@ public sealed partial class HFModelTask /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs index f51c8573..18ca48a2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs @@ -31,6 +31,10 @@ public enum HFTasksE /// /// /// + Hermes, + /// + /// + /// ImageClassification, /// /// @@ -39,6 +43,10 @@ public enum HFTasksE /// /// /// + Openclaw, + /// + /// + /// QuestionAnswering, /// /// @@ -79,6 +87,10 @@ public enum HFTasksE /// /// /// + WorldModel, + /// + /// + /// ZeroShotImageClassification, } @@ -99,8 +111,10 @@ public static string ToValueString(this HFTasksE value) HFTasksE.Dreambooth => "dreambooth", HFTasksE.Embeddings => "embeddings", HFTasksE.FillMask => "fill-mask", + HFTasksE.Hermes => "hermes", HFTasksE.ImageClassification => "image-classification", HFTasksE.ObjectDetection => "object-detection", + HFTasksE.Openclaw => "openclaw", HFTasksE.QuestionAnswering => "question-answering", HFTasksE.RentContainer => "rent-container", HFTasksE.Reranker => "reranker", @@ -111,6 +125,7 @@ public static string ToValueString(this HFTasksE value) HFTasksE.TextToVideo => "text-to-video", HFTasksE.Text2textGeneration => "text2text-generation", HFTasksE.TokenClassification => "token-classification", + HFTasksE.WorldModel => "world-model", HFTasksE.ZeroShotImageClassification => "zero-shot-image-classification", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; @@ -127,8 +142,10 @@ public static string ToValueString(this HFTasksE value) "dreambooth" => HFTasksE.Dreambooth, "embeddings" => HFTasksE.Embeddings, "fill-mask" => HFTasksE.FillMask, + "hermes" => HFTasksE.Hermes, "image-classification" => HFTasksE.ImageClassification, "object-detection" => HFTasksE.ObjectDetection, + "openclaw" => HFTasksE.Openclaw, "question-answering" => HFTasksE.QuestionAnswering, "rent-container" => HFTasksE.RentContainer, "reranker" => HFTasksE.Reranker, @@ -139,6 +156,7 @@ public static string ToValueString(this HFTasksE value) "text-to-video" => HFTasksE.TextToVideo, "text2text-generation" => HFTasksE.Text2textGeneration, "token-classification" => HFTasksE.TokenClassification, + "world-model" => HFTasksE.WorldModel, "zero-shot-image-classification" => HFTasksE.ZeroShotImageClassification, _ => null, }; diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.g.cs index e9e91189..36f1e820 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.g.cs @@ -64,5 +64,6 @@ public HFWeights( public HFWeights() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.g.cs index 8c4d177d..49c4f7fe 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.g.cs @@ -14,5 +14,6 @@ public sealed partial class HFWeightsRevision /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.g.cs index 0d23a55c..d3b15d9f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.g.cs @@ -14,5 +14,6 @@ public sealed partial class HFWeightsToken /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.g.cs index fe9d6bcf..c08e1932 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.g.cs @@ -39,5 +39,6 @@ public HTTPValidationError( public HTTPValidationError() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.g.cs index 6d355626..492be907 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.g.cs @@ -72,5 +72,6 @@ public HardwareOption( public HardwareOption() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.g.cs index 9e588890..a0031cdc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.g.cs @@ -40,5 +40,6 @@ public HardwarePricingDedicated( public HardwarePricingDedicated() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.g.cs index c4de72ea..a1c98b0c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.g.cs @@ -50,5 +50,6 @@ public HardwarePricingServerless( public HardwarePricingServerless() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.g.cs index 5166b437..f2a71568 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.g.cs @@ -39,5 +39,6 @@ public HardwareResponse( public HardwareResponse() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.g.cs index 02c951b0..429531b2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.g.cs @@ -52,5 +52,6 @@ public ImageURL( public ImageURL() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.g.cs index dfe142fe..114645f6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class InferenceDeployV1InferenceDeployDeployIdPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.g.cs index 23e019fd..069eb0d5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class InferenceDeployV1InferenceDeployDeployIdPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.g.cs index 82363cf8..d10329fd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class InferenceModelV1InferenceModelNamePostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.g.cs index 3c79cba5..ec31f6e2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.g.cs @@ -14,5 +14,6 @@ public sealed partial class InferenceModelV1InferenceModelNamePostVersion /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.g.cs index 362ca8e3..b1717871 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class InferenceModelV1InferenceModelNamePostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.cs index 3eca8103..1190e43a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.cs @@ -52,5 +52,6 @@ public InputAudio( public InputAudio() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.g.cs index d320e831..a8a32f81 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.g.cs @@ -65,5 +65,6 @@ public InspectScopedJWTOut( public InspectScopedJWTOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.g.cs index 378b1840..ec30fe61 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.g.cs @@ -14,5 +14,6 @@ public sealed partial class InspectScopedJWTOutModels /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.g.cs index ee4dc828..7fa52921 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.g.cs @@ -14,5 +14,6 @@ public sealed partial class InspectScopedJWTOutSpendingLimit /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.g.cs index 8d108dc3..8f9865b3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class InspectScopedJwtV1ScopedJwtGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.Json.g.cs new file mode 100644 index 00000000..9eb2c247 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoiceListItem + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoiceListItem), + jsonSerializerContext) as global::DeepInfra.InvoiceListItem; + } + + /// + /// 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::DeepInfra.InvoiceListItem? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.InvoiceListItem), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItem; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.g.cs new file mode 100644 index 00000000..0d0dd596 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoiceListItem + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Status { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("total")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Total { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("amount_due")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int AmountDue { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Created { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("period")] + public string? Period { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("invoice_type")] + public string? InvoiceType { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("hosted_invoice_url")] + public string? HostedInvoiceUrl { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("invoice_pdf")] + public string? InvoicePdf { 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 InvoiceListItem( + string id, + string status, + int total, + int amountDue, + int created, + string? period, + string? invoiceType, + string? hostedInvoiceUrl, + string? invoicePdf) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); + this.Total = total; + this.AmountDue = amountDue; + this.Created = created; + this.Period = period; + this.InvoiceType = invoiceType; + this.HostedInvoiceUrl = hostedInvoiceUrl; + this.InvoicePdf = invoicePdf; + } + + /// + /// Initializes a new instance of the class. + /// + public InvoiceListItem() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.Json.g.cs new file mode 100644 index 00000000..0a6d1745 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoiceListItemHostedInvoiceUrl + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItemHostedInvoiceUrl? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoiceListItemHostedInvoiceUrl), + jsonSerializerContext) as global::DeepInfra.InvoiceListItemHostedInvoiceUrl; + } + + /// + /// 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::DeepInfra.InvoiceListItemHostedInvoiceUrl? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.InvoiceListItemHostedInvoiceUrl), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItemHostedInvoiceUrl; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.g.cs new file mode 100644 index 00000000..a5e2b674 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoiceListItemHostedInvoiceUrl + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.Json.g.cs new file mode 100644 index 00000000..d0e7a53c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoiceListItemInvoicePdf + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItemInvoicePdf? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoiceListItemInvoicePdf), + jsonSerializerContext) as global::DeepInfra.InvoiceListItemInvoicePdf; + } + + /// + /// 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::DeepInfra.InvoiceListItemInvoicePdf? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.InvoiceListItemInvoicePdf), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItemInvoicePdf; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.g.cs new file mode 100644 index 00000000..f2dd9840 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoiceListItemInvoicePdf + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.Json.g.cs new file mode 100644 index 00000000..745de483 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoiceListItemInvoiceType + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItemInvoiceType? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoiceListItemInvoiceType), + jsonSerializerContext) as global::DeepInfra.InvoiceListItemInvoiceType; + } + + /// + /// 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::DeepInfra.InvoiceListItemInvoiceType? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.InvoiceListItemInvoiceType), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItemInvoiceType; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.g.cs new file mode 100644 index 00000000..e3699c36 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoiceListItemInvoiceType + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.Json.g.cs new file mode 100644 index 00000000..773c6796 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoiceListItemPeriod + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItemPeriod? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoiceListItemPeriod), + jsonSerializerContext) as global::DeepInfra.InvoiceListItemPeriod; + } + + /// + /// 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::DeepInfra.InvoiceListItemPeriod? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.InvoiceListItemPeriod), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItemPeriod; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.g.cs new file mode 100644 index 00000000..a28dcd72 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoiceListItemPeriod + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.Json.g.cs new file mode 100644 index 00000000..b8ec1a19 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoicesOut + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.InvoicesOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoicesOut), + jsonSerializerContext) as global::DeepInfra.InvoicesOut; + } + + /// + /// 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::DeepInfra.InvoicesOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.InvoicesOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoicesOut; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.g.cs new file mode 100644 index 00000000..7fa049cb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoicesOut + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("invoices")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Invoices { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("has_more")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool HasMore { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { 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 InvoicesOut( + global::System.Collections.Generic.IList invoices, + bool hasMore, + string? nextCursor) + { + this.Invoices = invoices ?? throw new global::System.ArgumentNullException(nameof(invoices)); + this.HasMore = hasMore; + this.NextCursor = nextCursor; + } + + /// + /// Initializes a new instance of the class. + /// + public InvoicesOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.Json.g.cs new file mode 100644 index 00000000..b269e799 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoicesOutNextCursor + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.InvoicesOutNextCursor? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoicesOutNextCursor), + jsonSerializerContext) as global::DeepInfra.InvoicesOutNextCursor; + } + + /// + /// 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::DeepInfra.InvoicesOutNextCursor? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.InvoicesOutNextCursor), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoicesOutNextCursor; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.g.cs new file mode 100644 index 00000000..1c3b2193 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoicesOutNextCursor + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.g.cs index 42290083..f5cb8fc1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.g.cs @@ -41,5 +41,6 @@ public JsonObjectResponseFormat( public JsonObjectResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.g.cs index e3fb1dea..9d5c7070 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.g.cs @@ -54,5 +54,6 @@ public JsonSchema( public JsonSchema() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.g.cs index b32f2fb7..3d79859f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.g.cs @@ -53,5 +53,6 @@ public JsonSchemaResponseFormat( public JsonSchemaResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaSchema.g.cs index 5bd361fc..8d2897fe 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class JsonSchemaSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.g.cs index 3638e6ba..756b40a7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.g.cs @@ -138,5 +138,6 @@ public LLMDeploymentStatsOut( public LLMDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.g.cs index 8624af92..90769024 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.g.cs @@ -14,5 +14,6 @@ public sealed partial class ListFilesV1FilesGetAfter /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.g.cs index eee9d300..3fb2c6c7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.g.cs @@ -14,5 +14,6 @@ public sealed partial class ListFilesV1FilesGetOrder /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.g.cs index 7a174fd5..33ef0dae 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.g.cs @@ -14,5 +14,6 @@ public sealed partial class ListFilesV1FilesGetPurpose /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.g.cs index 4b6b8222..3b7e1501 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ListFilesV1FilesGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.g.cs index f02094fe..77cd4e13 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ListFilesV1FilesGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.Json.g.cs deleted file mode 100644 index 21cbe6a2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1OpenaiFilesGetAfter - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ListFilesV1OpenaiFilesGetAfter? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetAfter), - jsonSerializerContext) as global::DeepInfra.ListFilesV1OpenaiFilesGetAfter; - } - - /// - /// 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::DeepInfra.ListFilesV1OpenaiFilesGetAfter? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.ListFilesV1OpenaiFilesGetAfter), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1OpenaiFilesGetAfter; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.g.cs deleted file mode 100644 index fdfa568c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1OpenaiFilesGetAfter - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.Json.g.cs deleted file mode 100644 index 287ffd81..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1OpenaiFilesGetOrder - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ListFilesV1OpenaiFilesGetOrder? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetOrder), - jsonSerializerContext) as global::DeepInfra.ListFilesV1OpenaiFilesGetOrder; - } - - /// - /// 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::DeepInfra.ListFilesV1OpenaiFilesGetOrder? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.ListFilesV1OpenaiFilesGetOrder), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1OpenaiFilesGetOrder; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.g.cs deleted file mode 100644 index 6dadb0fe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1OpenaiFilesGetOrder - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.Json.g.cs deleted file mode 100644 index 95c29f4e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1OpenaiFilesGetPurpose - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ListFilesV1OpenaiFilesGetPurpose? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetPurpose), - jsonSerializerContext) as global::DeepInfra.ListFilesV1OpenaiFilesGetPurpose; - } - - /// - /// 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::DeepInfra.ListFilesV1OpenaiFilesGetPurpose? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.ListFilesV1OpenaiFilesGetPurpose), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1OpenaiFilesGetPurpose; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.g.cs deleted file mode 100644 index 5463f94a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1OpenaiFilesGetPurpose - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.Json.g.cs deleted file mode 100644 index 49add4d9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1OpenaiFilesGetResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ListFilesV1OpenaiFilesGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetResponse), - jsonSerializerContext) as global::DeepInfra.ListFilesV1OpenaiFilesGetResponse; - } - - /// - /// 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::DeepInfra.ListFilesV1OpenaiFilesGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.ListFilesV1OpenaiFilesGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1OpenaiFilesGetResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.g.cs deleted file mode 100644 index 66305c87..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1OpenaiFilesGetResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.Json.g.cs deleted file mode 100644 index 19cba389..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1OpenaiFilesGetXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey; - } - - /// - /// 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::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.g.cs deleted file mode 100644 index 08f524ce..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1OpenaiFilesGetXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.Json.g.cs new file mode 100644 index 00000000..f967dfbe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ListInvoicesPaymentInvoicesGetInvoiceType + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ListInvoicesPaymentInvoicesGetInvoiceType? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ListInvoicesPaymentInvoicesGetInvoiceType), + jsonSerializerContext) as global::DeepInfra.ListInvoicesPaymentInvoicesGetInvoiceType; + } + + /// + /// 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::DeepInfra.ListInvoicesPaymentInvoicesGetInvoiceType? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ListInvoicesPaymentInvoicesGetInvoiceType), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListInvoicesPaymentInvoicesGetInvoiceType; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.g.cs new file mode 100644 index 00000000..2cf3199a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ListInvoicesPaymentInvoicesGetInvoiceType + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.Json.g.cs new file mode 100644 index 00000000..a25eabb7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ListInvoicesPaymentInvoicesGetSession + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ListInvoicesPaymentInvoicesGetSession? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ListInvoicesPaymentInvoicesGetSession), + jsonSerializerContext) as global::DeepInfra.ListInvoicesPaymentInvoicesGetSession; + } + + /// + /// 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::DeepInfra.ListInvoicesPaymentInvoicesGetSession? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ListInvoicesPaymentInvoicesGetSession), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListInvoicesPaymentInvoicesGetSession; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.g.cs new file mode 100644 index 00000000..0d5d569f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ListInvoicesPaymentInvoicesGetSession + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.Json.g.cs new file mode 100644 index 00000000..6bf364c7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ListInvoicesPaymentInvoicesGetStartingAfter + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ListInvoicesPaymentInvoicesGetStartingAfter? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ListInvoicesPaymentInvoicesGetStartingAfter), + jsonSerializerContext) as global::DeepInfra.ListInvoicesPaymentInvoicesGetStartingAfter; + } + + /// + /// 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::DeepInfra.ListInvoicesPaymentInvoicesGetStartingAfter? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ListInvoicesPaymentInvoicesGetStartingAfter), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListInvoicesPaymentInvoicesGetStartingAfter; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.g.cs new file mode 100644 index 00000000..5614e170 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ListInvoicesPaymentInvoicesGetStartingAfter + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.g.cs index 1ab1ed22..073ae18f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.g.cs @@ -12,7 +12,7 @@ public sealed partial class LogQueryOut /// list of log lines ordered by increasing timestamp /// [global::System.Text.Json.Serialization.JsonPropertyName("entries")] - public global::System.Collections.Generic.IList? Entries { get; set; } + public global::System.Collections.Generic.IList>? Entries { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -30,7 +30,7 @@ public sealed partial class LogQueryOut [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public LogQueryOut( - global::System.Collections.Generic.IList? entries) + global::System.Collections.Generic.IList>? entries) { this.Entries = entries; } @@ -41,5 +41,6 @@ public LogQueryOut( public LogQueryOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.g.cs index 5687f40e..5cc6b545 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.g.cs @@ -14,5 +14,6 @@ public sealed partial class LogsQueryV1LogsQueryGetFrom /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.g.cs index 569935c2..c5be0a0d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class LogsQueryV1LogsQueryGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.g.cs index 92d4a12f..ad408eb6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class LogsQueryV1LogsQueryGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.g.cs index 28e66cf0..89296a31 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.g.cs @@ -68,5 +68,6 @@ public LoraModelUploadIn( public LoraModelUploadIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.g.cs index cac995cd..6a84a70f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.g.cs @@ -14,5 +14,6 @@ public sealed partial class LoraModelUploadInBaseModelName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.g.cs index 8f37377d..eba6d22e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.g.cs @@ -14,5 +14,6 @@ public sealed partial class LoraModelUploadInHfToken /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.g.cs index 47b6a4e7..2110a34b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.g.cs @@ -68,6 +68,13 @@ public sealed partial class Me [global::System.Text.Json.Serialization.JsonRequired] public required bool IsAdmin { get; set; } + /// + /// Whether the user may use the hosted-agents feature (admins, plus the AGENTS_ACCESS_UIDS allowlist)
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("can_access_agents")] + public bool? CanAccessAgents { get; set; } + /// /// Personal name /// @@ -212,6 +219,10 @@ public sealed partial class Me /// Default Value: false /// /// + /// + /// Whether the user may use the hosted-agents feature (admins, plus the AGENTS_ACCESS_UIDS allowlist)
+ /// Default Value: false + /// /// /// Default Value: false /// @@ -246,6 +257,7 @@ public Me( string? email, bool? requireEmailVerified, string? picture, + bool? canAccessAgents, bool? isTeamAccount, bool? isTeamOwner, string? teamRole, @@ -263,6 +275,7 @@ public Me( this.Provider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); this.Picture = picture; this.IsAdmin = isAdmin; + this.CanAccessAgents = canAccessAgents; this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); this.FirstName = firstName ?? throw new global::System.ArgumentNullException(nameof(firstName)); this.LastName = lastName ?? throw new global::System.ArgumentNullException(nameof(lastName)); @@ -286,5 +299,6 @@ public Me( public Me() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.g.cs index fc0aa8fb..0acd7c33 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeChecklist /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.g.cs index 4f6d9c36..84f36449 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeEmail /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.g.cs index d879549f..88ab79bf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.g.cs @@ -80,6 +80,18 @@ public sealed partial class MeIn [global::System.Text.Json.Serialization.JsonPropertyName("attribution")] public string? Attribution { get; set; } + /// + /// Set to false to opt out of marketing emails + /// + [global::System.Text.Json.Serialization.JsonPropertyName("marketing_emails")] + public bool? MarketingEmails { get; set; } + + /// + /// ISO 3166-1 alpha-2 country code of the user selected country + /// + [global::System.Text.Json.Serialization.JsonPropertyName("country_code")] + public string? CountryCode { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -121,6 +133,12 @@ public sealed partial class MeIn /// /// Short description of how the user found out about DeepInfra /// + /// + /// Set to false to opt out of marketing emails + /// + /// + /// ISO 3166-1 alpha-2 country code of the user selected country + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -136,7 +154,9 @@ public MeIn( string? title, string? displayName, string? useCase, - string? attribution) + string? attribution, + bool? marketingEmails, + string? countryCode) { this.Name = name; this.FirstName = firstName; @@ -150,6 +170,8 @@ public MeIn( this.DisplayName = displayName; this.UseCase = useCase; this.Attribution = attribution; + this.MarketingEmails = marketingEmails; + this.CountryCode = countryCode; } /// @@ -158,5 +180,6 @@ public MeIn( public MeIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.g.cs index 8bf953d6..f59fe7bf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInAttribution /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.g.cs index d81013ae..7abefa9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInCompany /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.g.cs index 3db6a179..114af616 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInCountry /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.Json.g.cs new file mode 100644 index 00000000..63d4127b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class MeInCountryCode + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.MeInCountryCode? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.MeInCountryCode), + jsonSerializerContext) as global::DeepInfra.MeInCountryCode; + } + + /// + /// 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::DeepInfra.MeInCountryCode? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.MeInCountryCode), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInCountryCode; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.g.cs new file mode 100644 index 00000000..905179e0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// ISO 3166-1 alpha-2 country code of the user selected country + /// + public sealed partial class MeInCountryCode + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.g.cs index 239d2816..25a0f17e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInDisplayName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.g.cs index 9d1ba97b..46d5529d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInEmail /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.g.cs index 8341e0be..836a4e84 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInFirstName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.g.cs index 0c4bc7fd..095553c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInIsBusinessAccount /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.g.cs index c71a8e33..44ec50af 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInLastName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.Json.g.cs new file mode 100644 index 00000000..a51c05d9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class MeInMarketingEmails + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.MeInMarketingEmails? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.MeInMarketingEmails), + jsonSerializerContext) as global::DeepInfra.MeInMarketingEmails; + } + + /// + /// 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::DeepInfra.MeInMarketingEmails? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.MeInMarketingEmails), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInMarketingEmails; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.g.cs new file mode 100644 index 00000000..b246ebfe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Set to false to opt out of marketing emails + /// + public sealed partial class MeInMarketingEmails + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.g.cs index 44ae9219..e5c1715c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.g.cs index 9e423b8d..c475f2db 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInTitle /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.g.cs index 94405092..dd634d11 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInUseCase /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.g.cs index 18fd85a0..a8335e79 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInWebsite /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.g.cs index 4dfeca74..49c0f650 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.g.cs @@ -14,5 +14,6 @@ public sealed partial class MePicture /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.g.cs index ff7502ea..a23c24d9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeTeamDisplayName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.g.cs index 4857d5bb..9595a465 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeTeamRole /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.g.cs index 95a4d871..f86fe47b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeV1MeGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.g.cs index b2c7bee0..d38e1a61 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeVercelConnection /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.g.cs index c6eab454..0ce70326 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.g.cs @@ -59,5 +59,6 @@ public MeVercelConnection2( public MeVercelConnection2() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.g.cs index 2ebba383..aa823c1c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeVercelConnectionTeamId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.g.cs index 66776586..a2a4ccb8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelDeleteModelsModelNameDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.g.cs index 0f0d6fd2..e48f972b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelDeleteModelsModelNameDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.g.cs index d4783e3a..ea92114b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.g.cs @@ -51,5 +51,6 @@ public ModelDocBlock( public ModelDocBlock() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.g.cs index 5a97e4fc..38d381b8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.g.cs @@ -131,5 +131,6 @@ public ModelFamilyOut( public ModelFamilyOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.g.cs index 2128156b..f7dc3082 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFamilyOutMetaDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.g.cs index f3e09eca..45dbbd40 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFamilyOutMetaTitle /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.g.cs index 7b40f0ab..7f026b4a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.g.cs @@ -133,5 +133,6 @@ public ModelFieldInfo( public ModelFieldInfo() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.g.cs index 29e96b12..abb98d3c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoAllowed /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.g.cs index 525e59ba..f0608d35 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoAllowedVariant1Item /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.g.cs index c333e6fb..314d44bc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoDefault /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.g.cs index a62238ba..3699f742 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.g.cs index 480f2662..0301e018 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoExample /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.g.cs index 7ae1451b..cd2d10a0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoExclusiveMaximum /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.g.cs index 55e31282..b1a4c1e5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoExclusiveMinimum /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.g.cs index 0a24b053..03639cc1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoMaximum /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.g.cs index b5a00584..d6dc1c8a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoMinimum /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.g.cs index 92117148..de50b374 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoParent /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.g.cs index 12ff1be9..d22ad344 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.g.cs @@ -110,12 +110,6 @@ public sealed partial class ModelInfoOut [global::System.Text.Json.Serialization.JsonRequired] public required string OutDocs { get; set; } - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask_token")] - public string? MaskToken { get; set; } - /// /// /// @@ -138,9 +132,9 @@ public sealed partial class ModelInfoOut /// /// [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.AnyOf Pricing { get; set; } + public required global::DeepInfra.AnyOf Pricing { get; set; } /// /// @@ -267,7 +261,6 @@ public sealed partial class ModelInfoOut /// /// Default Value: false /// - /// /// /// /// @@ -308,12 +301,11 @@ public ModelInfoOut( string txtDocs, string outExample, string outDocs, - global::DeepInfra.AnyOf pricing, + global::DeepInfra.AnyOf pricing, global::System.Collections.Generic.IList schemas, string? description, string? mfDescription, bool? owner, - string? maskToken, object? inSchema, object? outSchema, global::System.Collections.Generic.IList? inFields, @@ -348,7 +340,6 @@ public ModelInfoOut( this.TxtDocs = txtDocs ?? throw new global::System.ArgumentNullException(nameof(txtDocs)); this.OutExample = outExample ?? throw new global::System.ArgumentNullException(nameof(outExample)); this.OutDocs = outDocs ?? throw new global::System.ArgumentNullException(nameof(outDocs)); - this.MaskToken = maskToken; this.InSchema = inSchema; this.OutSchema = outSchema; this.InFields = inFields; @@ -377,5 +368,6 @@ public ModelInfoOut( public ModelInfoOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.g.cs index e131cc55..fe4dcea4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutDeprecated /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.g.cs index d0865c18..537e308d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.g.cs index 4b06fefb..088cbf83 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutDocBlocks /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.g.cs index 35b64ef2..b7b20d33 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutExpected /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.g.cs index e719e8b5..77dca7da 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutImportTime /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.g.cs index 1f527ce3..7d6dee6f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutInFields /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.g.cs index 80cf6644..c02734c0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutInSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.Json.g.cs deleted file mode 100644 index 748b06ae..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutMaskToken - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ModelInfoOutMaskToken? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutMaskToken), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutMaskToken; - } - - /// - /// 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::DeepInfra.ModelInfoOutMaskToken? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.ModelInfoOutMaskToken), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMaskToken; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.g.cs deleted file mode 100644 index ccdfabde..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutMaskToken - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.g.cs index 25ce807f..8394afee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMaxOutputTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.g.cs index b326525a..8be8bd2c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMeta.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMeta.g.cs index 849e6adf..d8b28d24 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMeta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMeta.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMeta /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.g.cs index ad334b76..9c5b8230 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMfDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.g.cs index 161b812e..84a2573b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMfName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.g.cs index dfd93934..ce2de0ca 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMfTitle /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.g.cs index 6fe164ea..ac836137 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMmlu /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.g.cs index e69500cb..21670294 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutOutSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.g.cs index 883b0832..93c3cecb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutQuantization /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.g.cs index 0c9f9f43..0395e1f7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutReplacedBy /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.g.cs index 716cf061..f9ddf10d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutShortDocBlock /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs index 1270252d..90496325 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs @@ -80,5 +80,6 @@ public ModelMeta( public ModelMeta() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.g.cs index 85d04121..e428f002 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.g.cs @@ -107,5 +107,6 @@ public ModelMetaIn( public ModelMetaIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.g.cs index 3bd0bc55..7f0e1b5e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInCoverImgUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.g.cs index 9781ca4a..727be1bb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.g.cs index 012fee59..cc3bbc6a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInGithubUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.g.cs index 649ced18..6d330987 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInLicenseUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.g.cs index bf51cb9d..5cdd547e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInPaperUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.g.cs index 572deaba..a0285092 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInReadme /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReportedType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReportedType.g.cs index 76480d5e..cd373ee0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReportedType.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReportedType.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInReportedType /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.g.cs index b1778cff..1a05f37f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaPlanId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.g.cs index 834f71be..ac84bdbc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaUpdateModelsModelNameMetaPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.g.cs index d09bda81..dec88614 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaUpdateModelsModelNameMetaPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.cs index d9b0f627..a2c8aa35 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.cs @@ -4,7 +4,17 @@ namespace DeepInfra { /// - /// + /// Per-model metadata exposed by ``/v1/openai/models``.
+ /// Pricing key names are surface-specific:
+ /// - chat / vlm: {"input_tokens", "output_tokens", "cache_read_tokens"} ($/1M tokens)
+ /// - embed: {"input_tokens"} ($/1M tokens)
+ /// - image-gen: {"per_image_unit"} ($/image at default geometry)
+ /// - video-gen: {"output_seconds"} ($/sec generated)
+ /// - tts: {"input_characters"} ($/1M input chars)
+ /// - stt: {"input_seconds"} ($/sec input audio)
+ /// ``tags`` always carries the surface short alias (e.g. ``'chat'``,
+ /// ``'image-gen'``) and, for chat models, any of ``'vision'``,
+ /// ``'prompt_cache'``, ``'reasoning_effort'``, ``'reasoning'``. ///
public sealed partial class ModelMetadata { @@ -19,15 +29,13 @@ public sealed partial class ModelMetadata /// /// [global::System.Text.Json.Serialization.JsonPropertyName("context_length")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int ContextLength { get; set; } + public int? ContextLength { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int MaxTokens { get; set; } + public int? MaxTokens { get; set; } /// /// @@ -43,6 +51,24 @@ public sealed partial class ModelMetadata [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList Tags { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_width")] + public int? DefaultWidth { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_height")] + public int? DefaultHeight { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_iterations")] + public int? DefaultIterations { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -53,25 +79,34 @@ public sealed partial class ModelMetadata /// Initializes a new instance of the class. /// /// - /// - /// /// /// + /// + /// + /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ModelMetadata( string description, - int contextLength, - int maxTokens, global::System.Collections.Generic.Dictionary pricing, - global::System.Collections.Generic.IList tags) + global::System.Collections.Generic.IList tags, + int? contextLength, + int? maxTokens, + int? defaultWidth, + int? defaultHeight, + int? defaultIterations) { this.Description = description ?? throw new global::System.ArgumentNullException(nameof(description)); this.ContextLength = contextLength; this.MaxTokens = maxTokens; this.Pricing = pricing ?? throw new global::System.ArgumentNullException(nameof(pricing)); this.Tags = tags ?? throw new global::System.ArgumentNullException(nameof(tags)); + this.DefaultWidth = defaultWidth; + this.DefaultHeight = defaultHeight; + this.DefaultIterations = defaultIterations; } /// @@ -80,5 +115,6 @@ public ModelMetadata( public ModelMetadata() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.Json.g.cs new file mode 100644 index 00000000..34f30eac --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetadataContextLength + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataContextLength? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetadataContextLength), + jsonSerializerContext) as global::DeepInfra.ModelMetadataContextLength; + } + + /// + /// 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::DeepInfra.ModelMetadataContextLength? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelMetadataContextLength), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataContextLength; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.g.cs new file mode 100644 index 00000000..da896ef6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetadataContextLength + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.Json.g.cs new file mode 100644 index 00000000..75efb4fa --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetadataDefaultHeight + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataDefaultHeight? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetadataDefaultHeight), + jsonSerializerContext) as global::DeepInfra.ModelMetadataDefaultHeight; + } + + /// + /// 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::DeepInfra.ModelMetadataDefaultHeight? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelMetadataDefaultHeight), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataDefaultHeight; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.g.cs new file mode 100644 index 00000000..ed7e8431 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetadataDefaultHeight + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.Json.g.cs new file mode 100644 index 00000000..2667b97d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetadataDefaultIterations + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataDefaultIterations? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetadataDefaultIterations), + jsonSerializerContext) as global::DeepInfra.ModelMetadataDefaultIterations; + } + + /// + /// 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::DeepInfra.ModelMetadataDefaultIterations? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelMetadataDefaultIterations), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataDefaultIterations; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.g.cs new file mode 100644 index 00000000..dffc27f4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetadataDefaultIterations + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.Json.g.cs new file mode 100644 index 00000000..2226058a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetadataDefaultWidth + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataDefaultWidth? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetadataDefaultWidth), + jsonSerializerContext) as global::DeepInfra.ModelMetadataDefaultWidth; + } + + /// + /// 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::DeepInfra.ModelMetadataDefaultWidth? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelMetadataDefaultWidth), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataDefaultWidth; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.g.cs new file mode 100644 index 00000000..639be49b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetadataDefaultWidth + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.Json.g.cs new file mode 100644 index 00000000..a655b7ba --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetadataMaxTokens + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataMaxTokens? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetadataMaxTokens), + jsonSerializerContext) as global::DeepInfra.ModelMetadataMaxTokens; + } + + /// + /// 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::DeepInfra.ModelMetadataMaxTokens? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelMetadataMaxTokens), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataMaxTokens; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.g.cs new file mode 100644 index 00000000..366e2574 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetadataMaxTokens + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.cs index 2e843adf..5e71ab51 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetadataPricing /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelNameSuggestionOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelNameSuggestionOut.Json.g.cs new file mode 100644 index 00000000..50393090 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelNameSuggestionOut.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelNameSuggestionOut + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelNameSuggestionOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelNameSuggestionOut), + jsonSerializerContext) as global::DeepInfra.ModelNameSuggestionOut; + } + + /// + /// 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::DeepInfra.ModelNameSuggestionOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelNameSuggestionOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelNameSuggestionOut; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelNameSuggestionOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelNameSuggestionOut.g.cs new file mode 100644 index 00000000..39902706 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelNameSuggestionOut.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelNameSuggestionOut + { + /// + /// A model name that is currently free to claim (prefixed in username/model-name format). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelName { 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. + /// + /// + /// A model name that is currently free to claim (prefixed in username/model-name format). + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelNameSuggestionOut( + string modelName) + { + this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); + } + + /// + /// Initializes a new instance of the class. + /// + public ModelNameSuggestionOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.g.cs index a0df104f..2ae41295 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.g.cs @@ -51,9 +51,9 @@ public sealed partial class ModelOut /// The pricing type and cost for this model /// [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.AnyOf Pricing { get; set; } + public required global::DeepInfra.AnyOf Pricing { get; set; } /// /// The maximum context size of this model, if applicable @@ -91,6 +91,12 @@ public sealed partial class ModelOut [global::System.Text.Json.Serialization.JsonPropertyName("expected")] public string? Expected { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("create_ts")] + public string? CreateTs { get; set; } + /// /// Default Value: 0 /// @@ -141,6 +147,7 @@ public sealed partial class ModelOut /// /// /// + /// /// /// Default Value: 0 /// @@ -154,7 +161,7 @@ public ModelOut( string modelName, string type, string reportedType, - global::DeepInfra.AnyOf pricing, + global::DeepInfra.AnyOf pricing, string? description, string? coverImgUrl, global::System.Collections.Generic.IList? tags, @@ -164,6 +171,7 @@ public ModelOut( string? quantization, double? mmlu, string? expected, + string? createTs, int? @private, bool? isPartner) { @@ -180,6 +188,7 @@ public ModelOut( this.Quantization = quantization; this.Mmlu = mmlu; this.Expected = expected; + this.CreateTs = createTs; this.Private = @private; this.IsPartner = isPartner; } @@ -190,5 +199,6 @@ public ModelOut( public ModelOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.Json.g.cs new file mode 100644 index 00000000..c22d211e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelOutCreateTs + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelOutCreateTs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelOutCreateTs), + jsonSerializerContext) as global::DeepInfra.ModelOutCreateTs; + } + + /// + /// 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::DeepInfra.ModelOutCreateTs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelOutCreateTs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutCreateTs; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.g.cs new file mode 100644 index 00000000..4d61ac6b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelOutCreateTs + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.g.cs index 7d8c2b68..68cc9706 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutDeprecated /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.g.cs index 47b3f562..25d9ea59 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutExpected /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.g.cs index 2f17ab82..5fbb8f4b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.g.cs index dd88e584..25c27410 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutMmlu /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.g.cs index 296b5a3d..2b094d03 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutQuantization /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.g.cs index 6e7d3478..cd6e42bc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutReplacedBy /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.Json.g.cs new file mode 100644 index 00000000..28ab9d63 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelPricingFrameUnits + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingFrameUnits? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelPricingFrameUnits), + jsonSerializerContext) as global::DeepInfra.ModelPricingFrameUnits; + } + + /// + /// 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::DeepInfra.ModelPricingFrameUnits? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelPricingFrameUnits), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingFrameUnits; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.g.cs new file mode 100644 index 00000000..78009d2a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.g.cs @@ -0,0 +1,89 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelPricingFrameUnits + { + /// + /// Short description of the pricing, ideal for cards and headers + /// + [global::System.Text.Json.Serialization.JsonPropertyName("short")] + public string? Short { get; set; } + + /// + /// Full description of the pricing, perfect for details + /// + [global::System.Text.Json.Serialization.JsonPropertyName("full")] + public string? Full { get; set; } + + /// + /// Could be used to generate pricing tables + /// + [global::System.Text.Json.Serialization.JsonPropertyName("table")] + public object? Table { get; set; } + + /// + /// Default Value: frame_units + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_frame_unit")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double CentsPerFrameUnit { 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. + /// + /// + /// + /// Short description of the pricing, ideal for cards and headers + /// + /// + /// Full description of the pricing, perfect for details + /// + /// + /// Could be used to generate pricing tables + /// + /// + /// Default Value: frame_units + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelPricingFrameUnits( + double centsPerFrameUnit, + string? @short, + string? full, + object? table, + string? type) + { + this.Short = @short; + this.Full = full; + this.Table = table; + this.Type = type; + this.CentsPerFrameUnit = centsPerFrameUnit; + } + + /// + /// Initializes a new instance of the class. + /// + public ModelPricingFrameUnits() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.Json.g.cs new file mode 100644 index 00000000..ec6e01c1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelPricingFrameUnitsFull + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingFrameUnitsFull? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelPricingFrameUnitsFull), + jsonSerializerContext) as global::DeepInfra.ModelPricingFrameUnitsFull; + } + + /// + /// 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::DeepInfra.ModelPricingFrameUnitsFull? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelPricingFrameUnitsFull), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingFrameUnitsFull; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.g.cs new file mode 100644 index 00000000..1ed7da49 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Full description of the pricing, perfect for details + /// + public sealed partial class ModelPricingFrameUnitsFull + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.Json.g.cs new file mode 100644 index 00000000..57d5ce84 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelPricingFrameUnitsShort + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingFrameUnitsShort? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelPricingFrameUnitsShort), + jsonSerializerContext) as global::DeepInfra.ModelPricingFrameUnitsShort; + } + + /// + /// 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::DeepInfra.ModelPricingFrameUnitsShort? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelPricingFrameUnitsShort), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingFrameUnitsShort; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.g.cs new file mode 100644 index 00000000..f52251cc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Short description of the pricing, ideal for cards and headers + /// + public sealed partial class ModelPricingFrameUnitsShort + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable.Json.g.cs new file mode 100644 index 00000000..ea15033f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelPricingFrameUnitsTable + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingFrameUnitsTable? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelPricingFrameUnitsTable), + jsonSerializerContext) as global::DeepInfra.ModelPricingFrameUnitsTable; + } + + /// + /// 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::DeepInfra.ModelPricingFrameUnitsTable? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelPricingFrameUnitsTable), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingFrameUnitsTable; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable.g.cs new file mode 100644 index 00000000..7c3ce45c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Could be used to generate pricing tables + /// + public sealed partial class ModelPricingFrameUnitsTable + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable2.Json.g.cs new file mode 100644 index 00000000..9754909b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelPricingFrameUnitsTable2 + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingFrameUnitsTable2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelPricingFrameUnitsTable2), + jsonSerializerContext) as global::DeepInfra.ModelPricingFrameUnitsTable2; + } + + /// + /// 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::DeepInfra.ModelPricingFrameUnitsTable2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.ModelPricingFrameUnitsTable2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingFrameUnitsTable2; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable2.g.cs new file mode 100644 index 00000000..efb3dd01 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelPricingFrameUnitsTable2 + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.g.cs index 2592a077..8c760a53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.g.cs @@ -133,5 +133,6 @@ public ModelPricingImageUnits( public ModelPricingImageUnits() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.g.cs index 47f1bc1c..643f77d0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingImageUnitsDefaultPriceCents /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.g.cs index 1989728c..b9f12246 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingImageUnitsFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.g.cs index eff3ef73..4c648178 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingImageUnitsShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable.g.cs index 52b7e2da..42185500 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingImageUnitsTable /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.g.cs index 4bbcf2cb..1bee65a9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingImageUnitsTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.g.cs index e56a7995..9da0772b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.g.cs @@ -84,5 +84,6 @@ public ModelPricingInputCharacterLength( public ModelPricingInputCharacterLength() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.g.cs index b420d138..3628379b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputCharacterLengthFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.g.cs index 94aed5ed..6de01b22 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputCharacterLengthShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable.g.cs index 16ef7ea3..bed53a29 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputCharacterLengthTable /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.g.cs index 68a91c7b..c197dc4b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputCharacterLengthTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.g.cs index 3bda351f..85f90233 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.g.cs @@ -84,5 +84,6 @@ public ModelPricingInputLength( public ModelPricingInputLength() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.g.cs index 9e951b8c..9be7de7f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputLengthFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.g.cs index 5d517e47..89e1618d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputLengthShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable.g.cs index a539f475..1d26e193 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputLengthTable /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.g.cs index 4cd403ff..13da2c52 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputLengthTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.g.cs index 9861207b..797f9038 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.g.cs @@ -84,5 +84,6 @@ public ModelPricingInputTokens( public ModelPricingInputTokens() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.g.cs index 1cdf4a6d..80b375cb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputTokensFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.g.cs index 95aea410..5979daaa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputTokensShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable.g.cs index 9a48ae00..c2476253 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputTokensTable /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.g.cs index a8d96311..07b8bb7d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputTokensTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.g.cs index 8da9aeec..5ba97c50 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.g.cs @@ -84,5 +84,6 @@ public ModelPricingOutputLength( public ModelPricingOutputLength() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.g.cs index c87e9e9a..7a8d5d2a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingOutputLengthFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.g.cs index 8de949dc..39c38969 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingOutputLengthShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable.g.cs index 9b66b888..3fb4cc7b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingOutputLengthTable /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.g.cs index 658ccca7..6249751d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingOutputLengthTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.g.cs index db26957b..a6efe9d0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.g.cs @@ -84,5 +84,6 @@ public ModelPricingTime( public ModelPricingTime() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.g.cs index 20a609d0..9de6e894 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTimeFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.g.cs index 35a5fd37..56c96a20 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTimeShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable.g.cs index 72c8825a..39cf63c4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTimeTable /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.g.cs index 2442c079..e3920550 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTimeTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.g.cs index a3f1fbd1..befd92e3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.g.cs @@ -112,5 +112,6 @@ public ModelPricingTokens( public ModelPricingTokens() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.g.cs index 78b2d75f..16bf74f4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.g.cs index 16b435a3..ca2b7714 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensRatePerInputTokenCacheWrite /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.g.cs index 7ab1fb8a..c0b4b0aa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensRatePerInputTokenCached /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.g.cs index 7bf44e66..7f1daf74 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable.g.cs index ef6751e6..8df7d1bf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensTable /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.g.cs index 552eaf32..1a1ffd4c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.g.cs index 5a6b7976..515b40c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.g.cs @@ -84,5 +84,6 @@ public ModelPricingUptime( public ModelPricingUptime() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.g.cs index ae56eef8..26eb84e5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingUptimeFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.g.cs index 05516964..70b66cc7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingUptimeShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable.g.cs index cb10ab22..66280a38 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingUptimeTable /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.g.cs index 7b2a3df6..7d3b1ec9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingUptimeTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.g.cs index e5ef54ec..76a3f2cd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.g.cs @@ -42,5 +42,6 @@ public ModelPublicityIn( public ModelPublicityIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.g.cs index 2533a30d..0d2b92d3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPublicityModelsModelNamePublicityPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.g.cs index c38c4684..3f22b86f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPublicityModelsModelNamePublicityPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.g.cs index 0629f9a5..fb02e448 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelSchemaModelsModelNameSchemaVariantKeyGetVersion /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.g.cs index 0054485a..a234d853 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.g.cs index 23864c23..c2173957 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.g.cs @@ -66,5 +66,6 @@ public ModelVersionOut( public ModelVersionOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.g.cs index d9ff29eb..77801d85 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelVersionsModelsModelNameVersionsGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.g.cs index 11309c1b..945d197a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelsDeploymentListModelsDeploymentListGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.g.cs index 1fc7a314..dbfd266e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelsInfoModelsModelNameGetVersion /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.g.cs index 9fa3fbcf..d554c7cc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelsInfoModelsModelNameGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.g.cs index dd1ea94d..1ef00668 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.g.cs @@ -14,5 +14,6 @@ public sealed partial class OktaLoginOktaLoginGetLoginId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.g.cs index 14786d7e..41fcb10e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.g.cs @@ -14,5 +14,6 @@ public sealed partial class OktaLoginOktaLoginGetOrigin /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.g.cs index e9cd9553..43d85e2c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OktaLoginOktaLoginGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatch.g.cs index f432c893..ae975768 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatch.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatch.g.cs @@ -218,5 +218,6 @@ public OpenAIBatch( public OpenAIBatch() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancelledAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancelledAt.g.cs index 78526af1..dfd5a53b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancelledAt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancelledAt.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchCancelledAt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancellingAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancellingAt.g.cs index 705a9abb..06ef4873 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancellingAt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancellingAt.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchCancellingAt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCompletedAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCompletedAt.g.cs index 78486f2a..fad7910b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCompletedAt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCompletedAt.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchCompletedAt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrorFileId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrorFileId.g.cs index d7b1c74a..fef650ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrorFileId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrorFileId.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchErrorFileId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors.g.cs index 96a59014..e80d41e5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchErrors /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors2.g.cs index ba2fb4a0..ed8b377c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchErrors2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchExpiredAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchExpiredAt.g.cs index 2eb8f78c..5e2b78a3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchExpiredAt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchExpiredAt.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchExpiredAt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFailedAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFailedAt.g.cs index 6206661a..5971ab69 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFailedAt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFailedAt.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchFailedAt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFinalizingAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFinalizingAt.g.cs index 30175b88..c36db325 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFinalizingAt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFinalizingAt.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchFinalizingAt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchInProgressAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchInProgressAt.g.cs index feeeb0ef..3d656f36 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchInProgressAt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchInProgressAt.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchInProgressAt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata.g.cs index c24331c9..46e41c55 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchMetadata /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata2.g.cs index a163f68d..0bfcf56d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchMetadata2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchOutputFileId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchOutputFileId.g.cs index dd16d748..05f213ad 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchOutputFileId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchOutputFileId.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchOutputFileId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts.g.cs index 684dc680..e6d25d24 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchRequestCounts /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts2.g.cs index 9a852a49..778cc146 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchRequestCounts2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.g.cs index a69a3b1d..a3ad4d9c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.g.cs @@ -78,5 +78,6 @@ public OpenAIBatchesIn( public OpenAIBatchesIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata.g.cs index 3dffcf31..afd27514 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchesInMetadata /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.g.cs index 849dee33..a0b70621 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchesInMetadata2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs index e3e6c3d0..c468c9af 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs @@ -71,6 +71,12 @@ public sealed partial class OpenAIChatCompletionsIn [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter, object>))] public global::DeepInfra.AnyOf, object>? Stop { get; set; } + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stop_token_ids")] + public global::System.Collections.Generic.IList? StopTokenIds { get; set; } + /// /// number of sequences to return
/// Default Value: 1 @@ -144,7 +150,7 @@ public sealed partial class OpenAIChatCompletionsIn public global::DeepInfra.StreamOptions? StreamOptions { get; set; } /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. + /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. /// [global::System.Text.Json.Serialization.JsonPropertyName("reasoning_effort")] public global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? ReasoningEffort { get; set; } @@ -167,6 +173,12 @@ public sealed partial class OpenAIChatCompletionsIn [global::System.Text.Json.Serialization.JsonPropertyName("chat_template_kwargs")] public object? ChatTemplateKwargs { get; set; } + /// + /// If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("continue_final_message")] + public bool? ContinueFinalMessage { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -209,6 +221,9 @@ public sealed partial class OpenAIChatCompletionsIn /// /// up to 16 sequences where the API will stop generating further tokens /// + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// /// /// number of sequences to return
/// Default Value: 1 @@ -247,7 +262,7 @@ public sealed partial class OpenAIChatCompletionsIn /// streaming options /// /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. + /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. /// /// /// Reasoning configuration. @@ -258,6 +273,9 @@ public sealed partial class OpenAIChatCompletionsIn /// /// Chat template kwargs. /// + /// + /// If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -271,6 +289,7 @@ public OpenAIChatCompletionsIn( int? topK, int? maxTokens, global::DeepInfra.AnyOf, object>? stop, + global::System.Collections.Generic.IList? stopTokenIds, int? n, double? presencePenalty, double? frequencyPenalty, @@ -285,7 +304,8 @@ public OpenAIChatCompletionsIn( global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort, global::DeepInfra.ChatReasoningSettings? reasoning, string? promptCacheKey, - object? chatTemplateKwargs) + object? chatTemplateKwargs, + bool? continueFinalMessage) { this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.Messages = messages ?? throw new global::System.ArgumentNullException(nameof(messages)); @@ -296,6 +316,7 @@ public OpenAIChatCompletionsIn( this.TopK = topK; this.MaxTokens = maxTokens; this.Stop = stop; + this.StopTokenIds = stopTokenIds; this.N = n; this.PresencePenalty = presencePenalty; this.FrequencyPenalty = frequencyPenalty; @@ -311,6 +332,7 @@ public OpenAIChatCompletionsIn( this.Reasoning = reasoning; this.PromptCacheKey = promptCacheKey; this.ChatTemplateKwargs = chatTemplateKwargs; + this.ContinueFinalMessage = continueFinalMessage; } /// @@ -319,5 +341,6 @@ public OpenAIChatCompletionsIn( public OpenAIChatCompletionsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs.g.cs index 390e81da..58f8ccf3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInChatTemplateKwargs /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.g.cs index ec172e52..9b53296c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInChatTemplateKwargs2 ///
[global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.Json.g.cs new file mode 100644 index 00000000..eb49683e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIChatCompletionsInContinueFinalMessage + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInContinueFinalMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIChatCompletionsInContinueFinalMessage), + jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInContinueFinalMessage; + } + + /// + /// 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::DeepInfra.OpenAIChatCompletionsInContinueFinalMessage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenAIChatCompletionsInContinueFinalMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInContinueFinalMessage; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.g.cs new file mode 100644 index 00000000..49af9191 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message. + /// + public sealed partial class OpenAIChatCompletionsInContinueFinalMessage + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.g.cs index 2f58cf26..e582e0b7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInLogprobs /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.g.cs index 5dab1141..3fc654aa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.g.cs @@ -15,5 +15,6 @@ public sealed partial class OpenAIChatCompletionsInMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.g.cs index 55925ad0..c5b2dfdc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInPromptCacheKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoning.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoning.g.cs index 4420b506..4fe32e36 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoning.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoning.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInReasoning /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.g.cs index 441725cd..6385061c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. + /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. /// public sealed partial class OpenAIChatCompletionsInReasoningEffort { @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInReasoningEffort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort2.g.cs index c1afff0c..527d4759 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort2.g.cs @@ -24,6 +24,10 @@ public enum OpenAIChatCompletionsInReasoningEffort2 /// /// None, + /// + /// + /// + Xhigh, } /// @@ -42,6 +46,7 @@ public static string ToValueString(this OpenAIChatCompletionsInReasoningEffort2 OpenAIChatCompletionsInReasoningEffort2.Low => "low", OpenAIChatCompletionsInReasoningEffort2.Medium => "medium", OpenAIChatCompletionsInReasoningEffort2.None => "none", + OpenAIChatCompletionsInReasoningEffort2.Xhigh => "xhigh", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -56,6 +61,7 @@ public static string ToValueString(this OpenAIChatCompletionsInReasoningEffort2 "low" => OpenAIChatCompletionsInReasoningEffort2.Low, "medium" => OpenAIChatCompletionsInReasoningEffort2.Medium, "none" => OpenAIChatCompletionsInReasoningEffort2.None, + "xhigh" => OpenAIChatCompletionsInReasoningEffort2.Xhigh, _ => null, }; } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.g.cs index 0075abde..95e16b42 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInSeed /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStopTokenIds.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStopTokenIds.Json.g.cs new file mode 100644 index 00000000..9fa97d83 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStopTokenIds.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIChatCompletionsInStopTokenIds + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInStopTokenIds? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIChatCompletionsInStopTokenIds), + jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInStopTokenIds; + } + + /// + /// 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::DeepInfra.OpenAIChatCompletionsInStopTokenIds? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenAIChatCompletionsInStopTokenIds), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInStopTokenIds; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStopTokenIds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStopTokenIds.g.cs new file mode 100644 index 00000000..758dc8cb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStopTokenIds.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + public sealed partial class OpenAIChatCompletionsInStopTokenIds + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStreamOptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStreamOptions.g.cs index 9e0d45de..d6c41531 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStreamOptions.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStreamOptions.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInStreamOptions /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.g.cs index 878ca8ac..47a00465 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInTools /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.g.cs index ac5509fa..c23907ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInUser /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.g.cs index 7625126b..1a79f92a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.g.cs @@ -138,7 +138,7 @@ public sealed partial class OpenAICompletionsIn public global::DeepInfra.StreamOptions? StreamOptions { get; set; } /// - /// List of token IDs that will stop generation when encountered + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. /// [global::System.Text.Json.Serialization.JsonPropertyName("stop_token_ids")] public global::System.Collections.Generic.IList? StopTokenIds { get; set; } @@ -238,7 +238,7 @@ public sealed partial class OpenAICompletionsIn /// streaming options /// /// - /// List of token IDs that will stop generation when encountered + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. /// /// /// return tokens as token ids @@ -308,5 +308,6 @@ public OpenAICompletionsIn( public OpenAICompletionsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInData.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInData.g.cs index e95f2336..9f127126 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInData.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInData.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInData /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.g.cs index 7cf28c05..d9781dcc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInEcho /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.g.cs index 5e7f5079..3b596cc5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInLogprobs /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.g.cs index ba51ef8c..3a2d6c31 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.g.cs @@ -15,5 +15,6 @@ public sealed partial class OpenAICompletionsInMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.g.cs index a14d4a72..46c995ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInPromptCacheKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.g.cs index 058e6012..bb5e938a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInReturnTokensAsTokenIds /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.g.cs index 87b688e4..8e515c26 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInSeed /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.g.cs index 89c15069..66390bef 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// List of token IDs that will stop generation when encountered + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. /// public sealed partial class OpenAICompletionsInStopTokenIds { @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInStopTokenIds /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStreamOptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStreamOptions.g.cs index 7c166ff6..f92d2aaa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStreamOptions.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStreamOptions.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInStreamOptions /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.g.cs index 90151fa9..6b9a1cf3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInUser /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.cs index a64899a5..4588eb8e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.cs @@ -91,5 +91,6 @@ public OpenAIEmbeddingsIn( public OpenAIEmbeddingsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.g.cs index 0288ed29..81d3f371 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIEmbeddingsInDimensions /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.g.cs index 1a2ad41b..6d466873 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIEmbeddingsInServiceTier /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.g.cs index 85143abb..32d78a2d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.g.cs @@ -63,5 +63,6 @@ public OpenAIImageData( public OpenAIImageData() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.g.cs index 8ef9ee50..aa17df2a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImageDataB64Json /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.g.cs index 8630b6ed..dc035a34 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImageDataRevisedPrompt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.g.cs index 80178a45..22481adb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImageDataUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.g.cs index 949b18d2..7ba57268 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.g.cs @@ -150,5 +150,6 @@ public OpenAIImagesEditsIn( public OpenAIImagesEditsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.g.cs index f6e960ea..09ed5c41 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesEditsInMask /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInResponseFormat.g.cs index 7271d864..6c4bb275 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInResponseFormat.g.cs @@ -15,5 +15,6 @@ public sealed partial class OpenAIImagesEditsInResponseFormat /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.g.cs index 11e0fc82..612373a8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesEditsInUser /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.g.cs index 585a0ebf..5aaf2ded 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.g.cs @@ -126,5 +126,6 @@ public OpenAIImagesGenerationsIn( public OpenAIImagesGenerationsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.g.cs index 87c00f8e..83feeaa0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesGenerationsInQuality /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInResponseFormat.g.cs index 888e53ff..e0528a3a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInResponseFormat.g.cs @@ -15,5 +15,6 @@ public sealed partial class OpenAIImagesGenerationsInResponseFormat /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.g.cs index 21ba2e38..487d71d3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesGenerationsInStyle /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.g.cs index 3db81b9a..c1a058ac 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesGenerationsInUser /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.g.cs index abc11b13..d9c25438 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.g.cs @@ -54,5 +54,6 @@ public OpenAIImagesOut( public OpenAIImagesOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.g.cs index 19a66750..ccf8db22 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.g.cs @@ -116,5 +116,6 @@ public OpenAIImagesVariationsIn( public OpenAIImagesVariationsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.g.cs index bf90ee6d..38b1dc38 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.g.cs @@ -15,5 +15,6 @@ public sealed partial class OpenAIImagesVariationsInResponseFormat /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.g.cs index d145adf9..3f78fb57 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesVariationsInUser /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.cs index eb358842..3201e3a5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.cs @@ -99,5 +99,6 @@ public OpenAIModelOut( public OpenAIModelOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.g.cs index b50bd221..db67748f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIModelOutMetadata /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.g.cs index e5655c13..facf2d8f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.g.cs @@ -50,5 +50,6 @@ public OpenAIModelsOut( public OpenAIModelsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.g.cs index df7e1436..5717def7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.g.cs @@ -114,5 +114,6 @@ public OpenAITextToSpeechIn( public OpenAITextToSpeechIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody.g.cs index fdd3c727..171675a0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAITextToSpeechInExtraBody /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.g.cs index 03f59509..f30ac6ae 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAITextToSpeechInExtraBody2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.g.cs index 713d1a35..1e97a0de 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAITextToSpeechInServiceTier /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.g.cs index 42363541..d0ee6ef6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAITextToSpeechInVoice /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.Json.g.cs new file mode 100644 index 00000000..bce41b98 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawAgentTypeMetaOut + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawAgentTypeMetaOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawAgentTypeMetaOut), + jsonSerializerContext) as global::DeepInfra.OpenClawAgentTypeMetaOut; + } + + /// + /// 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::DeepInfra.OpenClawAgentTypeMetaOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawAgentTypeMetaOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawAgentTypeMetaOut; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.g.cs new file mode 100644 index 00000000..5ef09097 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawAgentTypeMetaOut + { + /// + /// Human-readable display name for the framework + /// + [global::System.Text.Json.Serialization.JsonPropertyName("pretty_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string PrettyName { get; set; } + + /// + /// Agent framework version + /// + [global::System.Text.Json.Serialization.JsonPropertyName("version")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Version { get; set; } + + /// + /// Whether instances of this framework expose a dashboard via the nginx proxy. False -> SSH-only; the UI should hide the dashboard launch affordance and surface the SSH connection string instead. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("has_dashboard")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool HasDashboard { get; set; } + + /// + /// Plans available for this agent type + /// + [global::System.Text.Json.Serialization.JsonPropertyName("plans")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Plans { 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. + /// + /// + /// Human-readable display name for the framework + /// + /// + /// Agent framework version + /// + /// + /// Whether instances of this framework expose a dashboard via the nginx proxy. False -> SSH-only; the UI should hide the dashboard launch affordance and surface the SSH connection string instead. + /// + /// + /// Plans available for this agent type + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawAgentTypeMetaOut( + string prettyName, + string version, + bool hasDashboard, + global::System.Collections.Generic.IList plans) + { + this.PrettyName = prettyName ?? throw new global::System.ArgumentNullException(nameof(prettyName)); + this.Version = version ?? throw new global::System.ArgumentNullException(nameof(version)); + this.HasDashboard = hasDashboard; + this.Plans = plans ?? throw new global::System.ArgumentNullException(nameof(plans)); + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawAgentTypeMetaOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.Json.g.cs new file mode 100644 index 00000000..3e181007 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawBackupOut + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawBackupOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawBackupOut), + jsonSerializerContext) as global::DeepInfra.OpenClawBackupOut; + } + + /// + /// 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::DeepInfra.OpenClawBackupOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawBackupOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawBackupOut; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.g.cs new file mode 100644 index 00000000..d45955fa --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawBackupOut + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("snapshot_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SnapshotName { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("size_in_gb")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int SizeInGb { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string State { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at_unix")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int CreatedAtUnix { 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 OpenClawBackupOut( + string snapshotName, + int sizeInGb, + string state, + int createdAtUnix) + { + this.SnapshotName = snapshotName ?? throw new global::System.ArgumentNullException(nameof(snapshotName)); + this.SizeInGb = sizeInGb; + this.State = state ?? throw new global::System.ArgumentNullException(nameof(state)); + this.CreatedAtUnix = createdAtUnix; + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawBackupOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.Json.g.cs new file mode 100644 index 00000000..573bd709 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawCatalogOut + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawCatalogOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawCatalogOut), + jsonSerializerContext) as global::DeepInfra.OpenClawCatalogOut; + } + + /// + /// 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::DeepInfra.OpenClawCatalogOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawCatalogOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawCatalogOut; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.g.cs new file mode 100644 index 00000000..8da0c9d3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.g.cs @@ -0,0 +1,20 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Per-agent-type catalog: keyed by agent_type_id, each entry carries the
+ /// current version and the plans available for that type. + ///
+ public sealed partial class OpenClawCatalogOut + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.Json.g.cs new file mode 100644 index 00000000..198d87f0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawCreateIn + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawCreateIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawCreateIn), + jsonSerializerContext) as global::DeepInfra.OpenClawCreateIn; + } + + /// + /// 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::DeepInfra.OpenClawCreateIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawCreateIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawCreateIn; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.g.cs new file mode 100644 index 00000000..b66e4124 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.g.cs @@ -0,0 +1,73 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawCreateIn + { + /// + /// Instance name + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Agent type identifier
+ /// Default Value: openclaw + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("agent_type_id")] + public string? AgentTypeId { get; set; } + + /// + /// Plan identifier
+ /// Default Value: standard + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("plan_id")] + public string? PlanId { 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. + /// + /// + /// Instance name + /// + /// + /// Agent type identifier
+ /// Default Value: openclaw + /// + /// + /// Plan identifier
+ /// Default Value: standard + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawCreateIn( + string name, + string? agentTypeId, + string? planId) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.AgentTypeId = agentTypeId; + this.PlanId = planId; + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawCreateIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.Json.g.cs new file mode 100644 index 00000000..79831fb9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawCreateOut + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawCreateOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawCreateOut), + jsonSerializerContext) as global::DeepInfra.OpenClawCreateOut; + } + + /// + /// 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::DeepInfra.OpenClawCreateOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawCreateOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawCreateOut; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.g.cs new file mode 100644 index 00000000..f68342fe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawCreateOut + { + /// + /// Instance ID + /// + [global::System.Text.Json.Serialization.JsonPropertyName("instance_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string InstanceId { 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. + /// + /// + /// Instance ID + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawCreateOut( + string instanceId) + { + this.InstanceId = instanceId ?? throw new global::System.ArgumentNullException(nameof(instanceId)); + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawCreateOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.Json.g.cs new file mode 100644 index 00000000..1a1e4af3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOut + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOut), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOut; + } + + /// + /// 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::DeepInfra.OpenClawInstanceOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawInstanceOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOut; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.g.cs new file mode 100644 index 00000000..97a895e8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.g.cs @@ -0,0 +1,181 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOut + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AgentInstanceStateJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::DeepInfra.AgentInstanceState State { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("start_ts")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int StartTs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("state_ts")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int StateTs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stop_ts")] + public int? StopTs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("price_per_hour")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double PricePerHour { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("region")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Region { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("last_backup_ts")] + public int? LastBackupTs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ssh_port")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int SshPort { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("fail_reason")] + public string? FailReason { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("public_ip")] + public string? PublicIp { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("version")] + public string? Version { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agent_type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AgentType { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("plan_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string PlanId { 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 OpenClawInstanceOut( + string id, + string name, + global::DeepInfra.AgentInstanceState state, + int startTs, + int stateTs, + double pricePerHour, + string region, + int sshPort, + string agentType, + string planId, + int? stopTs, + int? lastBackupTs, + string? failReason, + string? publicIp, + string? version) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.State = state; + this.StartTs = startTs; + this.StateTs = stateTs; + this.StopTs = stopTs; + this.PricePerHour = pricePerHour; + this.Region = region ?? throw new global::System.ArgumentNullException(nameof(region)); + this.LastBackupTs = lastBackupTs; + this.SshPort = sshPort; + this.FailReason = failReason; + this.PublicIp = publicIp; + this.Version = version; + this.AgentType = agentType ?? throw new global::System.ArgumentNullException(nameof(agentType)); + this.PlanId = planId ?? throw new global::System.ArgumentNullException(nameof(planId)); + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawInstanceOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.Json.g.cs new file mode 100644 index 00000000..85cee28d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOutFailReason + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOutFailReason? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOutFailReason), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOutFailReason; + } + + /// + /// 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::DeepInfra.OpenClawInstanceOutFailReason? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawInstanceOutFailReason), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOutFailReason; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.g.cs new file mode 100644 index 00000000..048b4fae --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOutFailReason + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.Json.g.cs new file mode 100644 index 00000000..1454cd01 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOutLastBackupTs + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOutLastBackupTs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOutLastBackupTs), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOutLastBackupTs; + } + + /// + /// 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::DeepInfra.OpenClawInstanceOutLastBackupTs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawInstanceOutLastBackupTs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOutLastBackupTs; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.g.cs new file mode 100644 index 00000000..4e327fa3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOutLastBackupTs + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.Json.g.cs new file mode 100644 index 00000000..c855a23b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOutPublicIp + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOutPublicIp? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOutPublicIp), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOutPublicIp; + } + + /// + /// 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::DeepInfra.OpenClawInstanceOutPublicIp? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawInstanceOutPublicIp), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOutPublicIp; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.g.cs new file mode 100644 index 00000000..1c006e66 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOutPublicIp + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.Json.g.cs new file mode 100644 index 00000000..50a778a0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOutStopTs + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOutStopTs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOutStopTs), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOutStopTs; + } + + /// + /// 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::DeepInfra.OpenClawInstanceOutStopTs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawInstanceOutStopTs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOutStopTs; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.g.cs new file mode 100644 index 00000000..876828ab --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOutStopTs + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.Json.g.cs new file mode 100644 index 00000000..5145d88d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOutVersion + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOutVersion? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOutVersion), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOutVersion; + } + + /// + /// 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::DeepInfra.OpenClawInstanceOutVersion? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawInstanceOutVersion), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOutVersion; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.g.cs new file mode 100644 index 00000000..2810f91f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOutVersion + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawLaunchTokenOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawLaunchTokenOut.Json.g.cs new file mode 100644 index 00000000..959908d6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawLaunchTokenOut.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawLaunchTokenOut + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawLaunchTokenOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawLaunchTokenOut), + jsonSerializerContext) as global::DeepInfra.OpenClawLaunchTokenOut; + } + + /// + /// 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::DeepInfra.OpenClawLaunchTokenOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawLaunchTokenOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawLaunchTokenOut; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawLaunchTokenOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawLaunchTokenOut.g.cs new file mode 100644 index 00000000..2b0a5822 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawLaunchTokenOut.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawLaunchTokenOut + { + /// + /// Single-use URL that opens the dashboard. Short TTL; mint right before navigating. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dashboard_url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DashboardUrl { 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. + /// + /// + /// Single-use URL that opens the dashboard. Short TTL; mint right before navigating. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawLaunchTokenOut( + string dashboardUrl) + { + this.DashboardUrl = dashboardUrl ?? throw new global::System.ArgumentNullException(nameof(dashboardUrl)); + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawLaunchTokenOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.Json.g.cs new file mode 100644 index 00000000..00b79028 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawPlanOut + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawPlanOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawPlanOut), + jsonSerializerContext) as global::DeepInfra.OpenClawPlanOut; + } + + /// + /// 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::DeepInfra.OpenClawPlanOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawPlanOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawPlanOut; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.g.cs new file mode 100644 index 00000000..308af0cb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawPlanOut + { + /// + /// Plan identifier + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Number of vCPUs + /// + [global::System.Text.Json.Serialization.JsonPropertyName("vcpu")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Vcpu { get; set; } + + /// + /// RAM in GB + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ram_gb")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int RamGb { get; set; } + + /// + /// Price in USD per hour + /// + [global::System.Text.Json.Serialization.JsonPropertyName("price_per_hour")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double PricePerHour { 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. + /// + /// + /// Plan identifier + /// + /// + /// Number of vCPUs + /// + /// + /// RAM in GB + /// + /// + /// Price in USD per hour + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawPlanOut( + string id, + int vcpu, + int ramGb, + double pricePerHour) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Vcpu = vcpu; + this.RamGb = ramGb; + this.PricePerHour = pricePerHour; + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawPlanOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.Json.g.cs new file mode 100644 index 00000000..d921a8a6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawUpdateIn + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawUpdateIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawUpdateIn), + jsonSerializerContext) as global::DeepInfra.OpenClawUpdateIn; + } + + /// + /// 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::DeepInfra.OpenClawUpdateIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenClawUpdateIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawUpdateIn; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.g.cs new file mode 100644 index 00000000..39bf0564 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawUpdateIn + { + /// + /// Instance name + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { 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. + /// + /// + /// Instance name + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawUpdateIn( + string name) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawUpdateIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.g.cs index cc1f3555..68e00978 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.g.cs @@ -42,5 +42,6 @@ public OpenRouterDatacenter( public OpenRouterDatacenter() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.g.cs index 33de60f8..39393d2c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.g.cs @@ -9,12 +9,18 @@ namespace DeepInfra public sealed partial class OpenRouterModelData { /// - /// Model identifier + /// Model identifier used when calling the provider API /// [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] public required string Id { get; set; } + /// + /// HuggingFace model ID if available + /// + [global::System.Text.Json.Serialization.JsonPropertyName("hugging_face_id")] + public string? HuggingFaceId { get; set; } + /// /// Human-readable model name /// @@ -22,6 +28,14 @@ public sealed partial class OpenRouterModelData [global::System.Text.Json.Serialization.JsonRequired] public required string Name { get; set; } + /// + /// Unix timestamp of model creation + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.UnixTimestampJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTimeOffset Created { get; set; } + /// /// Supported input modalities /// @@ -84,6 +98,12 @@ public sealed partial class OpenRouterModelData [global::System.Text.Json.Serialization.JsonPropertyName("description")] public string? Description { get; set; } + /// + /// ISO 8601 date YYYY-MM-DD for deprecation + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deprecation_date")] + public string? DeprecationDate { get; set; } + /// /// OpenRouter specific data /// @@ -107,11 +127,14 @@ public sealed partial class OpenRouterModelData /// Initializes a new instance of the class. /// /// - /// Model identifier + /// Model identifier used when calling the provider API /// /// /// Human-readable model name /// + /// + /// Unix timestamp of model creation + /// /// /// Supported input modalities /// @@ -139,9 +162,15 @@ public sealed partial class OpenRouterModelData /// /// Available datacenters /// + /// + /// HuggingFace model ID if available + /// /// /// Model description /// + /// + /// ISO 8601 date YYYY-MM-DD for deprecation + /// /// /// OpenRouter specific data /// @@ -151,6 +180,7 @@ public sealed partial class OpenRouterModelData public OpenRouterModelData( string id, string name, + global::System.DateTimeOffset created, global::System.Collections.Generic.IList inputModalities, global::System.Collections.Generic.IList outputModalities, string quantization, @@ -160,11 +190,15 @@ public OpenRouterModelData( global::System.Collections.Generic.IList supportedSamplingParameters, global::System.Collections.Generic.IList supportedFeatures, global::System.Collections.Generic.IList datacenters, + string? huggingFaceId, string? description, + string? deprecationDate, global::System.Collections.Generic.Dictionary? openrouter) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.HuggingFaceId = huggingFaceId; this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Created = created; this.InputModalities = inputModalities ?? throw new global::System.ArgumentNullException(nameof(inputModalities)); this.OutputModalities = outputModalities ?? throw new global::System.ArgumentNullException(nameof(outputModalities)); this.Quantization = quantization ?? throw new global::System.ArgumentNullException(nameof(quantization)); @@ -174,6 +208,7 @@ public OpenRouterModelData( this.SupportedSamplingParameters = supportedSamplingParameters ?? throw new global::System.ArgumentNullException(nameof(supportedSamplingParameters)); this.SupportedFeatures = supportedFeatures ?? throw new global::System.ArgumentNullException(nameof(supportedFeatures)); this.Description = description; + this.DeprecationDate = deprecationDate; this.Openrouter = openrouter; this.Datacenters = datacenters ?? throw new global::System.ArgumentNullException(nameof(datacenters)); } @@ -184,5 +219,6 @@ public OpenRouterModelData( public OpenRouterModelData() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.Json.g.cs new file mode 100644 index 00000000..c6179a05 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenRouterModelDataDeprecationDate + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterModelDataDeprecationDate? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenRouterModelDataDeprecationDate), + jsonSerializerContext) as global::DeepInfra.OpenRouterModelDataDeprecationDate; + } + + /// + /// 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::DeepInfra.OpenRouterModelDataDeprecationDate? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenRouterModelDataDeprecationDate), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelDataDeprecationDate; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.g.cs new file mode 100644 index 00000000..2da2d458 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// ISO 8601 date YYYY-MM-DD for deprecation + /// + public sealed partial class OpenRouterModelDataDeprecationDate + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.g.cs index 8d34a432..effa4e9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenRouterModelDataDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.g.cs index baaa3b3f..7bed2c40 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenRouterModelDataOpenrouter /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.g.cs index 1c889483..8c2e5e3c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenRouterModelDataOpenrouter2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.g.cs index 6494fc21..e9a97344 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.g.cs @@ -42,5 +42,6 @@ public OpenRouterModelsOut( public OpenRouterModelsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.g.cs index 43b35a65..c662b5c7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.g.cs @@ -22,6 +22,13 @@ public sealed partial class OpenRouterPricing [global::System.Text.Json.Serialization.JsonRequired] public required string Completion { get; set; } + /// + /// Pricing per 1 token for cache reads
+ /// Default Value: 0 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("input_cache_read")] + public string? InputCacheRead { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -37,15 +44,21 @@ public sealed partial class OpenRouterPricing /// /// Pricing per 1 token for output /// + /// + /// Pricing per 1 token for cache reads
+ /// Default Value: 0 + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public OpenRouterPricing( string prompt, - string completion) + string completion, + string? inputCacheRead) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.Completion = completion ?? throw new global::System.ArgumentNullException(nameof(completion)); + this.InputCacheRead = inputCacheRead; } /// @@ -54,5 +67,6 @@ public OpenRouterPricing( public OpenRouterPricing() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.g.cs index 9a1c4d64..6193ac62 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.g.cs index 5fdfd59c..34a2b4ea 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.g.cs index a89fa4c3..de1fff79 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.Json.g.cs deleted file mode 100644 index 6a73f8af..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse; - } - - /// - /// 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::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.g.cs deleted file mode 100644 index 4600fb32..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 372d5989..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource; - } - - /// - /// 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::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.g.cs deleted file mode 100644 index 531b3e66..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.Json.g.cs deleted file mode 100644 index 49cc3753..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.g.cs deleted file mode 100644 index 31be6bc1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.g.cs index 80760374..f20cc117 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostRe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.g.cs index a000f22b..be0806b0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXD /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.g.cs index 91d10003..158d9fe9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXi /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.Json.g.cs deleted file mode 100644 index 16d91347..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse; - } - - /// - /// 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::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.g.cs deleted file mode 100644 index 66780aec..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 75448104..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource; - } - - /// - /// 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::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.g.cs deleted file mode 100644 index 0253d209..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.Json.g.cs deleted file mode 100644 index 04b9ae85..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.g.cs deleted file mode 100644 index ae9b7159..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.g.cs index bb8d4dfb..d3a1727b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostRespon /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.g.cs index d716f614..7ce3d6ba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostXDeepi /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.g.cs index df1b1d13..e3975875 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostXiApiK /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.Json.g.cs deleted file mode 100644 index cb3f1b30..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse; - } - - /// - /// 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::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.g.cs deleted file mode 100644 index 748a2185..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 693ddd37..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource; - } - - /// - /// 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::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.g.cs deleted file mode 100644 index 46b559a7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.Json.g.cs deleted file mode 100644 index f6019ea8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.g.cs deleted file mode 100644 index 209d0baa..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.g.cs index 5f782f21..9f6947e5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.g.cs index a49ed09e..9f298a25 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfra /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.g.cs index 7b82d7e0..8b02fd39 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.Json.g.cs deleted file mode 100644 index ff5df855..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse; - } - - /// - /// 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::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.g.cs deleted file mode 100644 index b39159ff..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index d18c150b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource; - } - - /// - /// 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::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.g.cs deleted file mode 100644 index 974d2cb0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.Json.g.cs deleted file mode 100644 index bff6392b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.g.cs deleted file mode 100644 index 1bbb7489..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.g.cs index 57920d94..20e51082 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiCompletionsV1CompletionsPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.g.cs index c043e8c5..079f195d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiCompletionsV1CompletionsPostXDeepinfraSource /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.g.cs index 4110e179..43e990e8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiCompletionsV1CompletionsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.Json.g.cs deleted file mode 100644 index b6f1f111..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse; - } - - /// - /// 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::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.g.cs deleted file mode 100644 index fc9cbd62..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index e8d644a0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource; - } - - /// - /// 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::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.g.cs deleted file mode 100644 index bf074bfc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.Json.g.cs deleted file mode 100644 index df1d4d1d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.g.cs deleted file mode 100644 index b7d04f0d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.g.cs index eb76f509..99276a02 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.g.cs index 0ce2adde..91824011 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostUserAgent /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.g.cs index 0029c5c9..ffe6d42a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.g.cs index b4afd60f..ede76400 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.Json.g.cs deleted file mode 100644 index 4e2eb91d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse; - } - - /// - /// 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::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.g.cs deleted file mode 100644 index 647926f6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.Json.g.cs deleted file mode 100644 index 1c70bc02..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent; - } - - /// - /// 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::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.g.cs deleted file mode 100644 index cb437706..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 1f77cb83..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource; - } - - /// - /// 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::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.g.cs deleted file mode 100644 index 36875494..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.Json.g.cs deleted file mode 100644 index 1f6884c3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.g.cs deleted file mode 100644 index f9eb1ee1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.g.cs index 9cdaacdb..1a16609b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiFilesV1FilesPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.g.cs index 6e20b0ab..21f93a4b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiFilesV1FilesPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.Json.g.cs deleted file mode 100644 index 90b56999..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiFilesV1OpenaiFilesPostResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse; - } - - /// - /// 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::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.g.cs deleted file mode 100644 index a44cf084..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiFilesV1OpenaiFilesPostResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.Json.g.cs deleted file mode 100644 index 40e3032d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiFilesV1OpenaiFilesPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.g.cs deleted file mode 100644 index c43afaed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiFilesV1OpenaiFilesPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.g.cs index 0c9392b5..26e9d6a2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiImagesEditsV1ImagesEditsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.Json.g.cs deleted file mode 100644 index 0458ad58..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.g.cs deleted file mode 100644 index d46c3ac5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.g.cs index 3c84784c..d3210e38 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiK /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.Json.g.cs deleted file mode 100644 index 9f004397..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.g.cs deleted file mode 100644 index ddf3b8e0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.g.cs index 4c247057..60ebd43d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.Json.g.cs deleted file mode 100644 index 11765413..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.g.cs deleted file mode 100644 index 0371af14..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.Json.g.cs new file mode 100644 index 00000000..ad9ad3ae --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiModelsV1ModelsGetFilter + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiModelsV1ModelsGetFilter? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiModelsV1ModelsGetFilter), + jsonSerializerContext) as global::DeepInfra.OpenaiModelsV1ModelsGetFilter; + } + + /// + /// 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::DeepInfra.OpenaiModelsV1ModelsGetFilter? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenaiModelsV1ModelsGetFilter), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiModelsV1ModelsGetFilter; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.g.cs new file mode 100644 index 00000000..50fdc979 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiModelsV1ModelsGetFilter + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.Json.g.cs new file mode 100644 index 00000000..b34c0537 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiModelsV1ModelsGetSortBy + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiModelsV1ModelsGetSortBy? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiModelsV1ModelsGetSortBy), + jsonSerializerContext) as global::DeepInfra.OpenaiModelsV1ModelsGetSortBy; + } + + /// + /// 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::DeepInfra.OpenaiModelsV1ModelsGetSortBy? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenaiModelsV1ModelsGetSortBy), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiModelsV1ModelsGetSortBy; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.g.cs new file mode 100644 index 00000000..0e091192 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiModelsV1ModelsGetSortBy + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.g.cs index 81c870c6..956d1129 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiModelsV1ModelsGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.Json.g.cs deleted file mode 100644 index 6b76cf3c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiModelsV1OpenaiModelsGetXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey; - } - - /// - /// 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::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.g.cs deleted file mode 100644 index 1e681657..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiModelsV1OpenaiModelsGetXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..5d793e3c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawCatalogV1AgentsCatalogGetXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.g.cs new file mode 100644 index 00000000..79dacb59 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawCatalogV1AgentsCatalogGetXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..6e5046cb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawCreateV1AgentsPostXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawCreateV1AgentsPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawCreateV1AgentsPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawCreateV1AgentsPostXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawCreateV1AgentsPostXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawCreateV1AgentsPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawCreateV1AgentsPostXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.g.cs new file mode 100644 index 00000000..17b9faf6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawCreateV1AgentsPostXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.Json.g.cs new file mode 100644 index 00000000..39914c9d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawDeleteV1AgentsInstanceIdDeleteResponse + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteResponse), + jsonSerializerContext) as global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteResponse; + } + + /// + /// 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::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteResponse; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.g.cs new file mode 100644 index 00000000..508e6b8a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawDeleteV1AgentsInstanceIdDeleteResponse + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.Json.g.cs new file mode 100644 index 00000000..82acd3a3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.g.cs new file mode 100644 index 00000000..3de56b9d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..e7ef82d1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawGetV1AgentsInstanceIdGetXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.g.cs new file mode 100644 index 00000000..5bc11dcc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawGetV1AgentsInstanceIdGetXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..70f0739e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.g.cs new file mode 100644 index 00000000..3d5a2451 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..27348777 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.g.cs new file mode 100644 index 00000000..7ebfdad8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetState.g.cs new file mode 100644 index 00000000..016b5906 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetState.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Which instances to return: active, inactive, or all (both)
+ /// Default Value: active + ///
+ public enum OpenclawListV1AgentsGetState + { + /// + /// active, inactive, or all (both) + /// + Active, + /// + /// active, inactive, or all (both) + /// + All, + /// + /// active, inactive, or all (both) + /// + Inactive, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class OpenclawListV1AgentsGetStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this OpenclawListV1AgentsGetState value) + { + return value switch + { + OpenclawListV1AgentsGetState.Active => "active", + OpenclawListV1AgentsGetState.All => "all", + OpenclawListV1AgentsGetState.Inactive => "inactive", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static OpenclawListV1AgentsGetState? ToEnum(string value) + { + return value switch + { + "active" => OpenclawListV1AgentsGetState.Active, + "all" => OpenclawListV1AgentsGetState.All, + "inactive" => OpenclawListV1AgentsGetState.Inactive, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..dea1e9fe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawListV1AgentsGetXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawListV1AgentsGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawListV1AgentsGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawListV1AgentsGetXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawListV1AgentsGetXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawListV1AgentsGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawListV1AgentsGetXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.g.cs new file mode 100644 index 00000000..840c68de --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawListV1AgentsGetXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.Json.g.cs new file mode 100644 index 00000000..434c4415 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse), + jsonSerializerContext) as global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse; + } + + /// + /// 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::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.g.cs new file mode 100644 index 00000000..2f22461a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.Json.g.cs new file mode 100644 index 00000000..67263d7a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.g.cs new file mode 100644 index 00000000..2506ce49 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.Json.g.cs new file mode 100644 index 00000000..b19bafb6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawStartV1AgentsInstanceIdStartPostResponse + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostResponse), + jsonSerializerContext) as global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostResponse; + } + + /// + /// 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::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostResponse; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.g.cs new file mode 100644 index 00000000..d9d95a11 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawStartV1AgentsInstanceIdStartPostResponse + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..ac55863c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawStartV1AgentsInstanceIdStartPostXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.g.cs new file mode 100644 index 00000000..23a0d2de --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawStartV1AgentsInstanceIdStartPostXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.Json.g.cs new file mode 100644 index 00000000..2e802237 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawStopV1AgentsInstanceIdStopPostResponse + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostResponse), + jsonSerializerContext) as global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostResponse; + } + + /// + /// 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::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostResponse; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.g.cs new file mode 100644 index 00000000..8df6db7a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawStopV1AgentsInstanceIdStopPostResponse + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..631ca174 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawStopV1AgentsInstanceIdStopPostXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.g.cs new file mode 100644 index 00000000..9bbe981c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawStopV1AgentsInstanceIdStopPostXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.Json.g.cs new file mode 100644 index 00000000..7fa3a378 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse), + jsonSerializerContext) as global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse; + } + + /// + /// 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::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.g.cs new file mode 100644 index 00000000..4c911ffd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..bc983e70 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.g.cs new file mode 100644 index 00000000..46f4afd1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.Json.g.cs new file mode 100644 index 00000000..b22359a0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawUpdateV1AgentsInstanceIdPatchResponse + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchResponse), + jsonSerializerContext) as global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchResponse; + } + + /// + /// 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::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchResponse; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.g.cs new file mode 100644 index 00000000..2c84e9d8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawUpdateV1AgentsInstanceIdPatchResponse + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.Json.g.cs new file mode 100644 index 00000000..43bc7684 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.g.cs new file mode 100644 index 00000000..87ace748 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.Json.g.cs new file mode 100644 index 00000000..018519e2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse), + jsonSerializerContext) as global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse; + } + + /// + /// 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::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.g.cs new file mode 100644 index 00000000..d6460f8a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.Json.g.cs new file mode 100644 index 00000000..193cb865 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey; + } + + /// + /// 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::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.g.cs new file mode 100644 index 00000000..36970622 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfo.Json.g.cs new file mode 100644 index 00000000..2af4419c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfo.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodBankInfo + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodBankInfo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodBankInfo), + jsonSerializerContext) as global::DeepInfra.PaymentMethodBankInfo; + } + + /// + /// 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::DeepInfra.PaymentMethodBankInfo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodBankInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodBankInfo; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfo.g.cs new file mode 100644 index 00000000..a05770e2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfo.g.cs @@ -0,0 +1,53 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodBankInfo + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("bank_name")] + public string? BankName { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("last4")] + public string? Last4 { 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 PaymentMethodBankInfo( + string? bankName, + string? last4) + { + this.BankName = bankName; + this.Last4 = last4; + } + + /// + /// Initializes a new instance of the class. + /// + public PaymentMethodBankInfo() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoBankName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoBankName.Json.g.cs new file mode 100644 index 00000000..473e83bc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoBankName.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodBankInfoBankName + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodBankInfoBankName? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodBankInfoBankName), + jsonSerializerContext) as global::DeepInfra.PaymentMethodBankInfoBankName; + } + + /// + /// 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::DeepInfra.PaymentMethodBankInfoBankName? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodBankInfoBankName), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodBankInfoBankName; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoBankName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoBankName.g.cs new file mode 100644 index 00000000..3240512d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoBankName.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodBankInfoBankName + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoLast4.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoLast4.Json.g.cs new file mode 100644 index 00000000..6af69368 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoLast4.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodBankInfoLast4 + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodBankInfoLast4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodBankInfoLast4), + jsonSerializerContext) as global::DeepInfra.PaymentMethodBankInfoLast4; + } + + /// + /// 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::DeepInfra.PaymentMethodBankInfoLast4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodBankInfoLast4), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodBankInfoLast4; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoLast4.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoLast4.g.cs new file mode 100644 index 00000000..214f28b3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankInfoLast4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodBankInfoLast4 + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfo.Json.g.cs new file mode 100644 index 00000000..836eb31b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfo.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCardInfo + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCardInfo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCardInfo), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCardInfo; + } + + /// + /// 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::DeepInfra.PaymentMethodCardInfo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodCardInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCardInfo; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfo.g.cs new file mode 100644 index 00000000..4126a35e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfo.g.cs @@ -0,0 +1,53 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCardInfo + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("brand")] + public string? Brand { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("last4")] + public string? Last4 { 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 PaymentMethodCardInfo( + string? brand, + string? last4) + { + this.Brand = brand; + this.Last4 = last4; + } + + /// + /// Initializes a new instance of the class. + /// + public PaymentMethodCardInfo() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoBrand.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoBrand.Json.g.cs new file mode 100644 index 00000000..06277229 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoBrand.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCardInfoBrand + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCardInfoBrand? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCardInfoBrand), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCardInfoBrand; + } + + /// + /// 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::DeepInfra.PaymentMethodCardInfoBrand? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodCardInfoBrand), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCardInfoBrand; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoBrand.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoBrand.g.cs new file mode 100644 index 00000000..79c38f26 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoBrand.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCardInfoBrand + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoLast4.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoLast4.Json.g.cs new file mode 100644 index 00000000..a5eae428 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoLast4.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCardInfoLast4 + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCardInfoLast4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCardInfoLast4), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCardInfoLast4; + } + + /// + /// 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::DeepInfra.PaymentMethodCardInfoLast4? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodCardInfoLast4), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCardInfoLast4; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoLast4.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoLast4.g.cs new file mode 100644 index 00000000..16f2ade1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardInfoLast4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCardInfoLast4 + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfo.Json.g.cs new file mode 100644 index 00000000..4e5d17cb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfo.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCashAppInfo + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCashAppInfo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCashAppInfo), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCashAppInfo; + } + + /// + /// 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::DeepInfra.PaymentMethodCashAppInfo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodCashAppInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCashAppInfo; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfo.g.cs new file mode 100644 index 00000000..e6b9ff9f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfo.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCashAppInfo + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cashtag")] + public string? Cashtag { 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 PaymentMethodCashAppInfo( + string? cashtag) + { + this.Cashtag = cashtag; + } + + /// + /// Initializes a new instance of the class. + /// + public PaymentMethodCashAppInfo() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfoCashtag.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfoCashtag.Json.g.cs new file mode 100644 index 00000000..ee8e596c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfoCashtag.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCashAppInfoCashtag + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCashAppInfoCashtag? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCashAppInfoCashtag), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCashAppInfoCashtag; + } + + /// + /// 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::DeepInfra.PaymentMethodCashAppInfoCashtag? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodCashAppInfoCashtag), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCashAppInfoCashtag; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfoCashtag.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfoCashtag.g.cs new file mode 100644 index 00000000..ca49843a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppInfoCashtag.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCashAppInfoCashtag + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfo.Json.g.cs new file mode 100644 index 00000000..3b738301 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfo.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodInfo + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodInfo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodInfo), + jsonSerializerContext) as global::DeepInfra.PaymentMethodInfo; + } + + /// + /// 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::DeepInfra.PaymentMethodInfo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodInfo; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfo.g.cs new file mode 100644 index 00000000..36a2d8bd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfo.g.cs @@ -0,0 +1,72 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodInfo + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Type { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("card")] + public global::DeepInfra.PaymentMethodCardInfo? Card { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("us_bank_account")] + public global::DeepInfra.PaymentMethodBankInfo? UsBankAccount { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cashapp")] + public global::DeepInfra.PaymentMethodCashAppInfo? Cashapp { 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 PaymentMethodInfo( + string type, + global::DeepInfra.PaymentMethodCardInfo? card, + global::DeepInfra.PaymentMethodBankInfo? usBankAccount, + global::DeepInfra.PaymentMethodCashAppInfo? cashapp) + { + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); + this.Card = card; + this.UsBankAccount = usBankAccount; + this.Cashapp = cashapp; + } + + /// + /// Initializes a new instance of the class. + /// + public PaymentMethodInfo() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCard.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCard.Json.g.cs new file mode 100644 index 00000000..b0433212 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCard.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodInfoCard + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodInfoCard? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodInfoCard), + jsonSerializerContext) as global::DeepInfra.PaymentMethodInfoCard; + } + + /// + /// 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::DeepInfra.PaymentMethodInfoCard? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodInfoCard), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodInfoCard; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCard.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCard.g.cs new file mode 100644 index 00000000..882eefc7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCard.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodInfoCard + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCashapp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCashapp.Json.g.cs new file mode 100644 index 00000000..9476c86b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCashapp.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodInfoCashapp + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodInfoCashapp? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodInfoCashapp), + jsonSerializerContext) as global::DeepInfra.PaymentMethodInfoCashapp; + } + + /// + /// 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::DeepInfra.PaymentMethodInfoCashapp? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodInfoCashapp), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodInfoCashapp; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCashapp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCashapp.g.cs new file mode 100644 index 00000000..67391bc1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoCashapp.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodInfoCashapp + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoUsBankAccount.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoUsBankAccount.Json.g.cs new file mode 100644 index 00000000..90d26f0a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoUsBankAccount.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodInfoUsBankAccount + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodInfoUsBankAccount? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodInfoUsBankAccount), + jsonSerializerContext) as global::DeepInfra.PaymentMethodInfoUsBankAccount; + } + + /// + /// 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::DeepInfra.PaymentMethodInfoUsBankAccount? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.PaymentMethodInfoUsBankAccount), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodInfoUsBankAccount; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoUsBankAccount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoUsBankAccount.g.cs new file mode 100644 index 00000000..4d820ed8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodInfoUsBankAccount.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodInfoUsBankAccount + { + + /// + /// 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(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.g.cs index 9929f4f1..affb7e61 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.g.cs @@ -32,9 +32,9 @@ public sealed partial class PricingPageEntryOut /// /// [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.AnyOf Pricing { get; set; } + public required global::DeepInfra.AnyOf Pricing { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -57,7 +57,7 @@ public sealed partial class PricingPageEntryOut public PricingPageEntryOut( string modelName, string shortName, - global::DeepInfra.AnyOf pricing, + global::DeepInfra.AnyOf pricing, int? maxTokens) { this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); @@ -72,5 +72,6 @@ public PricingPageEntryOut( public PricingPageEntryOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.g.cs index 07193d18..cce8ed84 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.g.cs @@ -14,5 +14,6 @@ public sealed partial class PricingPageEntryOutMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.g.cs index c4aa0b83..dff0c091 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.g.cs @@ -92,5 +92,6 @@ public PricingPageSectionOut( public PricingPageSectionOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingType.g.cs index c837402f..eae04fa0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingType.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingType.g.cs @@ -8,6 +8,10 @@ namespace DeepInfra /// public enum PricingType { + /// + /// + /// + FrameUnits, /// /// /// @@ -54,6 +58,7 @@ public static string ToValueString(this PricingType value) { return value switch { + PricingType.FrameUnits => "frame_units", PricingType.ImageUnits => "image_units", PricingType.InputCharacterLength => "input_character_length", PricingType.InputLength => "input_length", @@ -72,6 +77,7 @@ public static string ToValueString(this PricingType value) { return value switch { + "frame_units" => PricingType.FrameUnits, "image_units" => PricingType.ImageUnits, "input_character_length" => PricingType.InputCharacterLength, "input_length" => PricingType.InputLength, diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.g.cs index 28258c6b..7281a720 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class PrivateModelsListModelsPrivateListGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.g.cs index 512ab873..d2ec6d53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.g.cs @@ -54,5 +54,6 @@ public RateLimitOut( public RateLimitOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.g.cs index 9cc791c3..06991e16 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.g.cs @@ -59,5 +59,6 @@ public RateLimitRequestIn( public RateLimitRequestIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.g.cs index c268c60c..6869b590 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.g.cs @@ -14,5 +14,6 @@ public sealed partial class RateLimitRequestInTpmRateLimit /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.g.cs index 8e3d811c..ba20e557 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.g.cs @@ -53,5 +53,6 @@ public RegexResponseFormat( public RegexResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.g.cs index 65445f30..bce9f707 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiA /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.g.cs index 3a025e0a..b80c534d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.g.cs @@ -50,5 +50,6 @@ public RequestCostItem( public RequestCostItem() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.g.cs index e0ea7418..fe0e942f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.g.cs @@ -40,5 +40,6 @@ public RequestCostQuery( public RequestCostQuery() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.g.cs index d16e2d55..5c938de4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.g.cs @@ -40,5 +40,6 @@ public RequestCostResponse( public RequestCostResponse() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.g.cs index 87516280..182d1635 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class RequestGpuLimitIncreaseV1MeGpuLimitRequestPostRespon /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.g.cs index 1ed09012..8dc6f1e2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiK /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.g.cs index fa274c8e..89cebd82 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class RequestRateLimitIncreaseV1MeRateLimitRequestPostResp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.g.cs index 3d935710..7c841559 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class RequestRateLimitIncreaseV1MeRateLimitRequestPostXiAp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.g.cs index 8fb23d7a..84052e99 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class RetrieveOpenaiBatchV1BatchesBatchIdGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.g.cs index 21a1d5b3..7f5d1254 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.Json.g.cs deleted file mode 100644 index 77884297..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse; - } - - /// - /// 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::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.g.cs deleted file mode 100644 index d3afb0c2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.Json.g.cs deleted file mode 100644 index 2a631754..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey; - } - - /// - /// 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::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.g.cs deleted file mode 100644 index 97ebaf51..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.g.cs index 40e3efa0..5e71cfc6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class RetrieveOpenaiBatchesV1BatchesGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.g.cs index bcb3d796..afe2ac4d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class RetrieveOpenaiBatchesV1BatchesGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.Json.g.cs deleted file mode 100644 index 8d6fb1c7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse; - } - - /// - /// 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::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.g.cs deleted file mode 100644 index 756c4fa7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.Json.g.cs deleted file mode 100644 index 99000508..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey; - } - - /// - /// 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::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.g.cs deleted file mode 100644 index 0cfdc8aa..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey - { - - /// - /// 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(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.g.cs index 028dca76..81ee01ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.g.cs @@ -56,5 +56,6 @@ public ScaleSettings( public ScaleSettings() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.g.cs index 532fbd0c..bf7bbf24 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.g.cs @@ -77,5 +77,6 @@ public SchemaOut( public SchemaOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.g.cs index 1d36cd3c..0a3c1fe0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaIn /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.g.cs index 9b73b6dd..60274459 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaIn2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.g.cs index aebbed26..a3158577 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaOut1 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.g.cs index eb7f1625..40d8ca93 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaOut12 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.g.cs index 77b289cf..487f9844 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaStream /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.g.cs index 1a767f37..aee87b3c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaStream2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.g.cs index 5865eb90..f2aa3e6e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.g.cs @@ -51,5 +51,6 @@ public SchemaVariant( public SchemaVariant() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.g.cs index 72b4a486..605e5a76 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.g.cs @@ -84,5 +84,6 @@ public ScopedJWTIn( public ScopedJWTIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.g.cs index acf80118..181eda9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.g.cs @@ -14,5 +14,6 @@ public sealed partial class ScopedJWTInExpiresAt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.g.cs index 6c5861df..2d9dcb36 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.g.cs @@ -14,5 +14,6 @@ public sealed partial class ScopedJWTInExpiresDelta /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.g.cs index d717dceb..7acdac46 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.g.cs @@ -14,5 +14,6 @@ public sealed partial class ScopedJWTInModels /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.g.cs index b7897cdc..0002a4c9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.g.cs @@ -14,5 +14,6 @@ public sealed partial class ScopedJWTInSpendingLimit /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.g.cs index ad63c4e2..72bd3321 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.g.cs @@ -42,5 +42,6 @@ public ScopedJWTOut( public ScopedJWTOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs index 37e2996e..f440edd5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class SetConfigPaymentConfigPostSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs index 7a8209ec..abdfcc50 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class SetupTopupPaymentTopupPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs index aa97e345..fcf4da7b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class SetupTopupPaymentTopupPostSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.g.cs index 96f0048d..8648baa9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.g.cs @@ -49,5 +49,6 @@ public SourceModel( public SourceModel() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.g.cs index 374e53a6..a8ac44d4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class SourceModelCivitUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.g.cs index 1d8f6189..f3d90352 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.g.cs @@ -54,5 +54,6 @@ public SshKeyIn( public SshKeyIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.g.cs index 13cc4f4d..7c4c50fc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.g.cs @@ -75,5 +75,6 @@ public SshKeyOut( public SshKeyOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.g.cs index 02c5bac9..f38ebf23 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.g.cs @@ -56,5 +56,6 @@ public StreamOptions( public StreamOptions() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.g.cs index aee490c0..18507a3e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class SubmitFeedbackV1FeedbackPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.g.cs index fdb92fa3..8d447ea9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class SubmitFeedbackV1FeedbackPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs index b70570ec..dd620fcd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs @@ -27,6 +27,10 @@ public enum SuspendReason /// /// /// + MissingAddress, + /// + /// + /// OverdueInvoices, /// /// @@ -50,6 +54,7 @@ public static string ToValueString(this SuspendReason value) SuspendReason.BadCc => "bad-cc", SuspendReason.Balance => "balance", SuspendReason.LimitReached => "limit-reached", + SuspendReason.MissingAddress => "missing-address", SuspendReason.OverdueInvoices => "overdue-invoices", SuspendReason.PaymentMethod => "payment-method", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), @@ -66,6 +71,7 @@ public static string ToValueString(this SuspendReason value) "bad-cc" => SuspendReason.BadCc, "balance" => SuspendReason.Balance, "limit-reached" => SuspendReason.LimitReached, + "missing-address" => SuspendReason.MissingAddress, "overdue-invoices" => SuspendReason.OverdueInvoices, "payment-method" => SuspendReason.PaymentMethod, _ => null, diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.g.cs index 55453961..9b50b990 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class TeamSetDisplayNameV1MeTeamDisplayNamePostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.g.cs index 66a559fe..b2c88b9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.g.cs index 49fed3e7..80fea699 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.g.cs @@ -41,5 +41,6 @@ public TextResponseFormat( public TextResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.g.cs index d8e4ef09..de286c8a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOut /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.g.cs index 44812c32..c956bc77 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostRes /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.g.cs index f8b8564f..af4ff721 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiA /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.g.cs index f8d1a844..c050b4ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.g.cs index 5ab8c72a..604a11f8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.g.cs index 845840f6..f1937b8f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.g.cs index 7cc081f9..de80af23 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.g.cs @@ -102,5 +102,6 @@ public TimeDeploymentStatsOut( public TimeDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.g.cs index 70a77d65..2187a509 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.g.cs @@ -52,5 +52,6 @@ public TimeInterval( public TimeInterval() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs index b188f7e4..2ef644a1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs @@ -69,5 +69,6 @@ public TopUpIn( public TopUpIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.g.cs index a3af9c73..83623270 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.g.cs @@ -48,5 +48,6 @@ public UpdateLoraApiRequest( public UpdateLoraApiRequest() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.g.cs index 4e713b05..3d5d3f57 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class UpdateLoraApiRequestDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.g.cs index c639c934..a78eceed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.g.cs @@ -14,5 +14,6 @@ public sealed partial class UpdateLoraApiRequestPrivate /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.g.cs index 8521774c..dfd7ccef 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class UpdateLoraV1LoraLoraNamePatchResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.g.cs index 2a0a675d..bb996534 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class UpdateLoraV1LoraLoraNamePatchXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.g.cs index c97affb1..b66b86ae 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.g.cs index f0be8bca..41922284 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class UploadLoraModelLoraModelPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs index daf72d09..a536e770 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageApiTokenPaymentUsageApiTokenGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.g.cs index 36dc98e4..ec0e7ffa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageApiTokenPaymentUsageApiTokenGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs index 8f79575d..ddd05847 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs @@ -111,5 +111,6 @@ public UsageItem( public UsageItem() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.g.cs index 57080aba..791cdb5f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageItemDiscount /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs index 6b34d7e2..a46652af 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs @@ -89,5 +89,6 @@ public UsageMonth( public UsageMonth() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs index b713e4eb..59c9be5b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs @@ -52,5 +52,6 @@ public UsageOut( public UsageOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs index 238a1356..b371659b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsagePaymentUsageGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.g.cs index 7ef9f675..9b6350a1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsagePaymentUsageGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs index f88797fb..a516e8fa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs @@ -42,5 +42,6 @@ public UsageRentOut( public UsageRentOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.g.cs index e5166f60..ba71e3ea 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageRentOutIdToDuration /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs index 2ddd488f..dda858aa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageRentPaymentUsageRentGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.g.cs index 32b3f35b..1ad2bfc5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageRentPaymentUsageRentGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs index b6ea2f10..dbba4f53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageTokensPaymentUsageTokensGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.g.cs index 47ef0820..d4696d9f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageTokensPaymentUsageTokensGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.g.cs index 464b534c..835105ad 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.g.cs @@ -60,5 +60,6 @@ public ValidationError( public ValidationError() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoURL.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoURL.Json.g.cs new file mode 100644 index 00000000..09f41967 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoURL.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoURL + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.VideoURL? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoURL), + jsonSerializerContext) as global::DeepInfra.VideoURL; + } + + /// + /// 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::DeepInfra.VideoURL? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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::DeepInfra.VideoURL), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoURL; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoURL.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoURL.g.cs new file mode 100644 index 00000000..171f436a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoURL.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoURL + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { 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 VideoURL( + string url) + { + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + } + + /// + /// Initializes a new instance of the class. + /// + public VideoURL() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.g.cs index 1b7b2b85..31389cab 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.g.cs @@ -87,5 +87,6 @@ public Voice( public Voice() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.g.cs index e9124b13..3e4b643e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.g.cs @@ -74,5 +74,6 @@ public WebLiveMetricsOut( public WebLiveMetricsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.g.cs index a381df5b..7c450c9f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.g.cs @@ -14,5 +14,6 @@ public sealed partial class WebLiveMetricsOutRequestsPerSecond /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.g.cs index 2f7decc3..3579a415 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.g.cs @@ -14,5 +14,6 @@ public sealed partial class WebLiveMetricsOutTimeToFirstToken /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.g.cs index 2337b82e..883c3679 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.g.cs @@ -14,5 +14,6 @@ public sealed partial class WebLiveMetricsOutTokensPerSecond /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.g.cs index 1fed5054..3c8d5334 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.g.cs @@ -14,5 +14,6 @@ public sealed partial class WebLiveMetricsOutTotalTflops /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.GetHardware.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.GetHardware.g.cs new file mode 100644 index 00000000..2c59ae73 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.GetHardware.g.cs @@ -0,0 +1,483 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetHardwareSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetHardwareSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetHardwareSecurityRequirement0, + }; + partial void PrepareGetHardwareArguments( + global::System.Net.Http.HttpClient httpClient, + ref string model, + ref string? xiApiKey); + partial void PrepareGetHardwareRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string model, + string? xiApiKey); + partial void ProcessGetHardwareResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetHardwareResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Hardware + /// + /// + /// Model name (NVIDIA NemoClaw format) + /// + /// + /// 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 GetHardwareAsync( + string model, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetHardwareAsResponseAsync( + model: model, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Hardware + /// + /// + /// Model name (NVIDIA NemoClaw format) + /// + /// + /// 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> GetHardwareAsResponseAsync( + string model, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetHardwareArguments( + httpClient: HttpClient, + model: ref model, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetHardwareSecurityRequirements, + operationName: "GetHardwareAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v2/hardware", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("model", model) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetHardwareRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + model: model!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetHardware", + methodName: "GetHardwareAsync", + pathTemplate: "\"/v2/hardware\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetHardware", + methodName: "GetHardwareAsync", + pathTemplate: "\"/v2/hardware\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetHardware", + methodName: "GetHardwareAsync", + pathTemplate: "\"/v2/hardware\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetHardwareResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetHardware", + methodName: "GetHardwareAsync", + pathTemplate: "\"/v2/hardware\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetHardware", + methodName: "GetHardwareAsync", + pathTemplate: "\"/v2/hardware\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetHardwareResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.HardwareResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.HardwareResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelDelete.g.cs new file mode 100644 index 00000000..0cb74dce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelDelete.g.cs @@ -0,0 +1,562 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelDeleteSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelDeleteSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelDeleteSecurityRequirement0, + }; + partial void PrepareModelDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelName, + ref string version, + ref string? xiApiKey); + partial void PrepareModelDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string version, + string? xiApiKey); + partial void ProcessModelDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelDeleteResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Model Delete + /// + /// + /// + /// delete a particular version, pass 'ALL' to wipe everything + /// + /// + /// 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 ModelDeleteAsync( + string modelName, + string version, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelDeleteAsResponseAsync( + modelName: modelName, + version: version, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Model Delete + /// + /// + /// + /// delete a particular version, pass 'ALL' to wipe everything + /// + /// + /// 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> ModelDeleteAsResponseAsync( + string modelName, + string version, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelDeleteArguments( + httpClient: HttpClient, + modelName: ref modelName, + version: ref version, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelDeleteSecurityRequirements, + operationName: "ModelDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/models/{modelName}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("version", version) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + version: version!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelDelete", + methodName: "ModelDeleteAsync", + pathTemplate: "$\"/models/{modelName}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelDelete", + methodName: "ModelDeleteAsync", + pathTemplate: "$\"/models/{modelName}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelDelete", + methodName: "ModelDeleteAsync", + pathTemplate: "$\"/models/{modelName}\"", + httpMethod: "DELETE", + 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::DeepInfra.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); + ProcessModelDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelDelete", + methodName: "ModelDeleteAsync", + pathTemplate: "$\"/models/{modelName}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelDelete", + methodName: "ModelDeleteAsync", + pathTemplate: "$\"/models/{modelName}\"", + httpMethod: "DELETE", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessModelDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelFamiliesNames.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelFamiliesNames.g.cs new file mode 100644 index 00000000..31834093 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelFamiliesNames.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelFamiliesNamesSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelFamiliesNamesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelFamiliesNamesSecurityRequirement0, + }; + partial void PrepareModelFamiliesNamesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareModelFamiliesNamesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessModelFamiliesNamesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelFamiliesNamesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Model Families Names + /// + /// 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> ModelFamiliesNamesAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelFamiliesNamesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Model Families Names + /// + /// 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>> ModelFamiliesNamesAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelFamiliesNamesArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelFamiliesNamesSecurityRequirements, + operationName: "ModelFamiliesNamesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/model-families/names", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelFamiliesNamesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamiliesNames", + methodName: "ModelFamiliesNamesAsync", + pathTemplate: "\"/model-families/names\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamiliesNames", + methodName: "ModelFamiliesNamesAsync", + pathTemplate: "\"/model-families/names\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamiliesNames", + methodName: "ModelFamiliesNamesAsync", + pathTemplate: "\"/model-families/names\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessModelFamiliesNamesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamiliesNames", + methodName: "ModelFamiliesNamesAsync", + pathTemplate: "\"/model-families/names\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamiliesNames", + methodName: "ModelFamiliesNamesAsync", + pathTemplate: "\"/model-families/names\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelFamiliesNamesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelFamily.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelFamily.g.cs new file mode 100644 index 00000000..d08f2c60 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelFamily.g.cs @@ -0,0 +1,498 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelFamilySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelFamilySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelFamilySecurityRequirement0, + }; + partial void PrepareModelFamilyArguments( + global::System.Net.Http.HttpClient httpClient, + ref string familyName); + partial void PrepareModelFamilyRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string familyName); + partial void ProcessModelFamilyResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelFamilyResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Model Family + /// + /// + /// 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 ModelFamilyAsync( + string familyName, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelFamilyAsResponseAsync( + familyName: familyName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Model Family + /// + /// + /// 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> ModelFamilyAsResponseAsync( + string familyName, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelFamilyArguments( + httpClient: HttpClient, + familyName: ref familyName); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelFamilySecurityRequirements, + operationName: "ModelFamilyAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/model-families/{familyName}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelFamilyRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + familyName: familyName!); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamily", + methodName: "ModelFamilyAsync", + pathTemplate: "$\"/model-families/{familyName}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamily", + methodName: "ModelFamilyAsync", + pathTemplate: "$\"/model-families/{familyName}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamily", + methodName: "ModelFamilyAsync", + pathTemplate: "$\"/model-families/{familyName}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessModelFamilyResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamily", + methodName: "ModelFamilyAsync", + pathTemplate: "$\"/model-families/{familyName}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamily", + methodName: "ModelFamilyAsync", + pathTemplate: "$\"/model-families/{familyName}\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessModelFamilyResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ModelFamilyOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.ModelFamilyOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelMetaUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelMetaUpdate.g.cs new file mode 100644 index 00000000..af5ad251 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelMetaUpdate.g.cs @@ -0,0 +1,626 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelMetaUpdateSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelMetaUpdateSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelMetaUpdateSecurityRequirement0, + }; + partial void PrepareModelMetaUpdateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelName, + ref string? xiApiKey, + global::DeepInfra.ModelMetaIn request); + partial void PrepareModelMetaUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? xiApiKey, + global::DeepInfra.ModelMetaIn request); + partial void ProcessModelMetaUpdateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelMetaUpdateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Model Meta Update + /// + /// + /// + /// + /// 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 ModelMetaUpdateAsync( + string modelName, + + global::DeepInfra.ModelMetaIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelMetaUpdateAsResponseAsync( + modelName: modelName, + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Model Meta Update + /// + /// + /// + /// + /// 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> ModelMetaUpdateAsResponseAsync( + string modelName, + + global::DeepInfra.ModelMetaIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareModelMetaUpdateArguments( + httpClient: HttpClient, + modelName: ref modelName, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelMetaUpdateSecurityRequirements, + operationName: "ModelMetaUpdateAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/models/{modelName}/meta", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelMetaUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelMetaUpdate", + methodName: "ModelMetaUpdateAsync", + pathTemplate: "$\"/models/{modelName}/meta\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelMetaUpdate", + methodName: "ModelMetaUpdateAsync", + pathTemplate: "$\"/models/{modelName}/meta\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelMetaUpdate", + methodName: "ModelMetaUpdateAsync", + pathTemplate: "$\"/models/{modelName}/meta\"", + 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::DeepInfra.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); + ProcessModelMetaUpdateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelMetaUpdate", + methodName: "ModelMetaUpdateAsync", + pathTemplate: "$\"/models/{modelName}/meta\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelMetaUpdate", + methodName: "ModelMetaUpdateAsync", + pathTemplate: "$\"/models/{modelName}/meta\"", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessModelMetaUpdateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Model Meta Update + /// + /// + /// + /// + /// short model description in plain text + /// + /// + /// source code project link (empty to delete) + /// + /// + /// paper/research link (empty to delete) + /// + /// + /// usage license link (empty to delete) + /// + /// + /// markdown flavored model readme + /// + /// + /// dataurl or regular url to cover image (empty to delete) + /// + /// + /// model type + /// + /// 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 ModelMetaUpdateAsync( + string modelName, + string? xiApiKey = default, + string? description = default, + string? githubUrl = default, + string? paperUrl = default, + string? licenseUrl = default, + string? readme = default, + string? coverImgUrl = default, + global::DeepInfra.HFTasksE? reportedType = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ModelMetaIn + { + Description = description, + GithubUrl = githubUrl, + PaperUrl = paperUrl, + LicenseUrl = licenseUrl, + Readme = readme, + CoverImgUrl = coverImgUrl, + ReportedType = reportedType, + }; + + return await ModelMetaUpdateAsync( + modelName: modelName, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelPublicity.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelPublicity.g.cs new file mode 100644 index 00000000..03d7feff --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelPublicity.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelPublicitySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelPublicitySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelPublicitySecurityRequirement0, + }; + partial void PrepareModelPublicityArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelName, + ref string? xiApiKey, + global::DeepInfra.ModelPublicityIn request); + partial void PrepareModelPublicityRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? xiApiKey, + global::DeepInfra.ModelPublicityIn request); + partial void ProcessModelPublicityResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelPublicityResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Model Publicity + /// + /// + /// + /// + /// 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 ModelPublicityAsync( + string modelName, + + global::DeepInfra.ModelPublicityIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelPublicityAsResponseAsync( + modelName: modelName, + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Model Publicity + /// + /// + /// + /// + /// 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> ModelPublicityAsResponseAsync( + string modelName, + + global::DeepInfra.ModelPublicityIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareModelPublicityArguments( + httpClient: HttpClient, + modelName: ref modelName, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelPublicitySecurityRequirements, + operationName: "ModelPublicityAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/models/{modelName}/publicity", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelPublicityRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelPublicity", + methodName: "ModelPublicityAsync", + pathTemplate: "$\"/models/{modelName}/publicity\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelPublicity", + methodName: "ModelPublicityAsync", + pathTemplate: "$\"/models/{modelName}/publicity\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelPublicity", + methodName: "ModelPublicityAsync", + pathTemplate: "$\"/models/{modelName}/publicity\"", + 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::DeepInfra.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); + ProcessModelPublicityResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelPublicity", + methodName: "ModelPublicityAsync", + pathTemplate: "$\"/models/{modelName}/publicity\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelPublicity", + methodName: "ModelPublicityAsync", + pathTemplate: "$\"/models/{modelName}/publicity\"", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessModelPublicityResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Model Publicity + /// + /// + /// + /// + /// whether to make the model public of private + /// + /// 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 ModelPublicityAsync( + string modelName, + bool @public, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ModelPublicityIn + { + Public = @public, + }; + + return await ModelPublicityAsync( + modelName: modelName, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelSchema.g.cs new file mode 100644 index 00000000..c170ff4d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelSchema.g.cs @@ -0,0 +1,608 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelSchemaSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelSchemaSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelSchemaSecurityRequirement0, + }; + partial void PrepareModelSchemaArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelName, + ref global::DeepInfra.SchemaVariantKey variantKey, + ref string? version, + ref string? xiApiKey); + partial void PrepareModelSchemaRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + global::DeepInfra.SchemaVariantKey variantKey, + string? version, + string? xiApiKey); + partial void ProcessModelSchemaResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelSchemaResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Model Schema + /// + /// + /// + /// + /// + /// 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 ModelSchemaAsync( + string modelName, + global::DeepInfra.SchemaVariantKey variantKey, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelSchemaAsResponseAsync( + modelName: modelName, + variantKey: variantKey, + version: version, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Model Schema + /// + /// + /// + /// + /// + /// 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> ModelSchemaAsResponseAsync( + string modelName, + global::DeepInfra.SchemaVariantKey variantKey, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelSchemaArguments( + httpClient: HttpClient, + modelName: ref modelName, + variantKey: ref variantKey, + version: ref version, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelSchemaSecurityRequirements, + operationName: "ModelSchemaAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/models/{modelName}/schema/{(global::System.Uri.EscapeDataString(variantKey.ToValueString()))}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("version", version) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelSchemaRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + variantKey: variantKey!, + version: version, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelSchema", + methodName: "ModelSchemaAsync", + pathTemplate: "$\"/models/{modelName}/schema/{(global::System.Uri.EscapeDataString(variantKey.ToValueString()))}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelSchema", + methodName: "ModelSchemaAsync", + pathTemplate: "$\"/models/{modelName}/schema/{(global::System.Uri.EscapeDataString(variantKey.ToValueString()))}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelSchema", + methodName: "ModelSchemaAsync", + pathTemplate: "$\"/models/{modelName}/schema/{(global::System.Uri.EscapeDataString(variantKey.ToValueString()))}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessModelSchemaResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelSchema", + methodName: "ModelSchemaAsync", + pathTemplate: "$\"/models/{modelName}/schema/{(global::System.Uri.EscapeDataString(variantKey.ToValueString()))}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelSchema", + methodName: "ModelSchemaAsync", + pathTemplate: "$\"/models/{modelName}/schema/{(global::System.Uri.EscapeDataString(variantKey.ToValueString()))}\"", + httpMethod: "GET", + 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); + } + // Forbidden + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::DeepInfra.DeepError? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Locked + if ((int)__response.StatusCode == 423) + { + string? __content_423 = null; + global::System.Exception? __exception_423 = null; + global::DeepInfra.DeepError? __value_423 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_423 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); + } + else + { + __content_423 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_423 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_423, + responseBody: __content_423, + responseObject: __value_423, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessModelSchemaResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.SchemaOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.SchemaOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelVersions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelVersions.g.cs new file mode 100644 index 00000000..587ae37a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelVersions.g.cs @@ -0,0 +1,513 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelVersionsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelVersionsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelVersionsSecurityRequirement0, + }; + partial void PrepareModelVersionsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelName, + ref string? xiApiKey); + partial void PrepareModelVersionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? xiApiKey); + partial void ProcessModelVersionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelVersionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Model Versions + /// + /// + /// + /// 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> ModelVersionsAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelVersionsAsResponseAsync( + modelName: modelName, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Model Versions + /// + /// + /// + /// 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>> ModelVersionsAsResponseAsync( + string modelName, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelVersionsArguments( + httpClient: HttpClient, + modelName: ref modelName, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelVersionsSecurityRequirements, + operationName: "ModelVersionsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/models/{modelName}/versions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelVersionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelVersions", + methodName: "ModelVersionsAsync", + pathTemplate: "$\"/models/{modelName}/versions\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelVersions", + methodName: "ModelVersionsAsync", + pathTemplate: "$\"/models/{modelName}/versions\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelVersions", + methodName: "ModelVersionsAsync", + pathTemplate: "$\"/models/{modelName}/versions\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessModelVersionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelVersions", + methodName: "ModelVersionsAsync", + pathTemplate: "$\"/models/{modelName}/versions\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelVersions", + methodName: "ModelVersionsAsync", + pathTemplate: "$\"/models/{modelName}/versions\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessModelVersionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsDeploymentList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsDeploymentList.g.cs new file mode 100644 index 00000000..42b45f6d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsDeploymentList.g.cs @@ -0,0 +1,467 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelsDeploymentListSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelsDeploymentListSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelsDeploymentListSecurityRequirement0, + }; + partial void PrepareModelsDeploymentListArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareModelsDeploymentListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessModelsDeploymentListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsDeploymentListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Models Deployment List + /// + /// + /// 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> ModelsDeploymentListAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsDeploymentListAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Models Deployment List + /// + /// + /// 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>> ModelsDeploymentListAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsDeploymentListArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelsDeploymentListSecurityRequirements, + operationName: "ModelsDeploymentListAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/models/deployment/list", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsDeploymentListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsDeploymentList", + methodName: "ModelsDeploymentListAsync", + pathTemplate: "\"/models/deployment/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsDeploymentList", + methodName: "ModelsDeploymentListAsync", + pathTemplate: "\"/models/deployment/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsDeploymentList", + methodName: "ModelsDeploymentListAsync", + pathTemplate: "\"/models/deployment/list\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessModelsDeploymentListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsDeploymentList", + methodName: "ModelsDeploymentListAsync", + pathTemplate: "\"/models/deployment/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsDeploymentList", + methodName: "ModelsDeploymentListAsync", + pathTemplate: "\"/models/deployment/list\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessModelsDeploymentListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsFeatured.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsFeatured.g.cs new file mode 100644 index 00000000..0b6ffac7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsFeatured.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelsFeaturedSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelsFeaturedSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelsFeaturedSecurityRequirement0, + }; + partial void PrepareModelsFeaturedArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareModelsFeaturedRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessModelsFeaturedResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsFeaturedResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Models Featured + /// + /// 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> ModelsFeaturedAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsFeaturedAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Models Featured + /// + /// 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>> ModelsFeaturedAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsFeaturedArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelsFeaturedSecurityRequirements, + operationName: "ModelsFeaturedAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/models/featured", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsFeaturedRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsFeatured", + methodName: "ModelsFeaturedAsync", + pathTemplate: "\"/models/featured\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsFeatured", + methodName: "ModelsFeaturedAsync", + pathTemplate: "\"/models/featured\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsFeatured", + methodName: "ModelsFeaturedAsync", + pathTemplate: "\"/models/featured\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessModelsFeaturedResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsFeatured", + methodName: "ModelsFeaturedAsync", + pathTemplate: "\"/models/featured\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsFeatured", + methodName: "ModelsFeaturedAsync", + pathTemplate: "\"/models/featured\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelsFeaturedResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsInfo.g.cs new file mode 100644 index 00000000..5fbee29d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsInfo.g.cs @@ -0,0 +1,525 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelsInfoSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelsInfoSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelsInfoSecurityRequirement0, + }; + partial void PrepareModelsInfoArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelName, + ref string? version, + ref string? xiApiKey); + partial void PrepareModelsInfoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? version, + string? xiApiKey); + partial void ProcessModelsInfoResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsInfoResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Models Info + /// + /// + /// + /// + /// 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 ModelsInfoAsync( + string modelName, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsInfoAsResponseAsync( + modelName: modelName, + version: version, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Models Info + /// + /// + /// + /// + /// 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> ModelsInfoAsResponseAsync( + string modelName, + string? version = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsInfoArguments( + httpClient: HttpClient, + modelName: ref modelName, + version: ref version, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelsInfoSecurityRequirements, + operationName: "ModelsInfoAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/models/{modelName}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("version", version) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsInfoRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + version: version, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsInfo", + methodName: "ModelsInfoAsync", + pathTemplate: "$\"/models/{modelName}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsInfo", + methodName: "ModelsInfoAsync", + pathTemplate: "$\"/models/{modelName}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsInfo", + methodName: "ModelsInfoAsync", + pathTemplate: "$\"/models/{modelName}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessModelsInfoResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsInfo", + methodName: "ModelsInfoAsync", + pathTemplate: "$\"/models/{modelName}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsInfo", + methodName: "ModelsInfoAsync", + pathTemplate: "$\"/models/{modelName}\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessModelsInfoResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ModelInfoOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.ModelInfoOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsList.g.cs new file mode 100644 index 00000000..2a2dcef3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsList.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelsListSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelsListSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelsListSecurityRequirement0, + }; + partial void PrepareModelsListArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareModelsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessModelsListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Models List + /// + /// 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> ModelsListAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsListAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Models List + /// + /// 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>> ModelsListAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsListArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelsListSecurityRequirements, + operationName: "ModelsListAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/models/list", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsList", + methodName: "ModelsListAsync", + pathTemplate: "\"/models/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsList", + methodName: "ModelsListAsync", + pathTemplate: "\"/models/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsList", + methodName: "ModelsListAsync", + pathTemplate: "\"/models/list\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessModelsListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsList", + methodName: "ModelsListAsync", + pathTemplate: "\"/models/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsList", + methodName: "ModelsListAsync", + pathTemplate: "\"/models/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelsListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsLoraList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsLoraList.g.cs new file mode 100644 index 00000000..d93246e4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsLoraList.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelsLoraListSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelsLoraListSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelsLoraListSecurityRequirement0, + }; + partial void PrepareModelsLoraListArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareModelsLoraListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessModelsLoraListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsLoraListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Models Lora List + /// + /// 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> ModelsLoraListAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsLoraListAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Models Lora List + /// + /// 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>> ModelsLoraListAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsLoraListArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelsLoraListSecurityRequirements, + operationName: "ModelsLoraListAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/models/lora/list", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsLoraListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsLoraList", + methodName: "ModelsLoraListAsync", + pathTemplate: "\"/models/lora/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsLoraList", + methodName: "ModelsLoraListAsync", + pathTemplate: "\"/models/lora/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsLoraList", + methodName: "ModelsLoraListAsync", + pathTemplate: "\"/models/lora/list\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessModelsLoraListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsLoraList", + methodName: "ModelsLoraListAsync", + pathTemplate: "\"/models/lora/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsLoraList", + methodName: "ModelsLoraListAsync", + pathTemplate: "\"/models/lora/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelsLoraListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.OpenaiModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.OpenaiModels.g.cs new file mode 100644 index 00000000..e2eafdac --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.OpenaiModels.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiModelsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiModelsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiModelsSecurityRequirement0, + }; + partial void PrepareOpenaiModelsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? sortBy, + ref string? filter, + ref string? xiApiKey); + partial void PrepareOpenaiModelsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? sortBy, + string? filter, + string? xiApiKey); + partial void ProcessOpenaiModelsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiModelsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Models + /// + /// + /// + /// + /// 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 OpenaiModelsAsync( + string? sortBy = default, + string? filter = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiModelsAsResponseAsync( + sortBy: sortBy, + filter: filter, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Models + /// + /// + /// + /// + /// 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> OpenaiModelsAsResponseAsync( + string? sortBy = default, + string? filter = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenaiModelsArguments( + httpClient: HttpClient, + sortBy: ref sortBy, + filter: ref filter, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiModelsSecurityRequirements, + operationName: "OpenaiModelsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/models", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("sort_by", sortBy) + .AddOptionalParameter("filter", filter) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiModelsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sortBy: sortBy, + filter: filter, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiModels", + methodName: "OpenaiModelsAsync", + pathTemplate: "\"/v1/models\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiModels", + methodName: "OpenaiModelsAsync", + pathTemplate: "\"/v1/models\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiModels", + methodName: "OpenaiModelsAsync", + pathTemplate: "\"/v1/models\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessOpenaiModelsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiModels", + methodName: "OpenaiModelsAsync", + pathTemplate: "\"/v1/models\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiModels", + methodName: "OpenaiModelsAsync", + pathTemplate: "\"/v1/models\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiModelsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenAIModelsOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenAIModelsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.OpenrouterModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.OpenrouterModels.g.cs new file mode 100644 index 00000000..3abaa9b7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.OpenrouterModels.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenrouterModelsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenrouterModelsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenrouterModelsSecurityRequirement0, + }; + partial void PrepareOpenrouterModelsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareOpenrouterModelsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessOpenrouterModelsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenrouterModelsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openrouter Models + /// + /// 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 OpenrouterModelsAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenrouterModelsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openrouter Models + /// + /// 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> OpenrouterModelsAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenrouterModelsArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenrouterModelsSecurityRequirements, + operationName: "OpenrouterModelsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/openrouter/models", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenrouterModelsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenrouterModels", + methodName: "OpenrouterModelsAsync", + pathTemplate: "\"/openrouter/models\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenrouterModels", + methodName: "OpenrouterModelsAsync", + pathTemplate: "\"/openrouter/models\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenrouterModels", + methodName: "OpenrouterModelsAsync", + pathTemplate: "\"/openrouter/models\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessOpenrouterModelsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenrouterModels", + methodName: "OpenrouterModelsAsync", + pathTemplate: "\"/openrouter/models\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenrouterModels", + methodName: "OpenrouterModelsAsync", + pathTemplate: "\"/openrouter/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenrouterModelsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenRouterModelsOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.OpenRouterModelsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.PrivateModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.PrivateModelsList.g.cs new file mode 100644 index 00000000..b62fd9e5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.PrivateModelsList.g.cs @@ -0,0 +1,467 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_PrivateModelsListSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_PrivateModelsListSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_PrivateModelsListSecurityRequirement0, + }; + partial void PreparePrivateModelsListArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PreparePrivateModelsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessPrivateModelsListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessPrivateModelsListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Private Models List + /// + /// + /// 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> PrivateModelsListAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PrivateModelsListAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Private Models List + /// + /// + /// 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>> PrivateModelsListAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PreparePrivateModelsListArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_PrivateModelsListSecurityRequirements, + operationName: "PrivateModelsListAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/models/private/list", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PreparePrivateModelsListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PrivateModelsList", + methodName: "PrivateModelsListAsync", + pathTemplate: "\"/models/private/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PrivateModelsList", + methodName: "PrivateModelsListAsync", + pathTemplate: "\"/models/private/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PrivateModelsList", + methodName: "PrivateModelsListAsync", + pathTemplate: "\"/models/private/list\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessPrivateModelsListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PrivateModelsList", + methodName: "PrivateModelsListAsync", + pathTemplate: "\"/models/private/list\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "PrivateModelsList", + methodName: "PrivateModelsListAsync", + pathTemplate: "\"/models/private/list\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessPrivateModelsListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.g.cs new file mode 100644 index 00000000..9f818b69 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Browse, search, and manage AI models.
+ /// 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 ModelsClient : global::DeepInfra.IModelsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ModelsClient. + /// 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 ModelsClient( + 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 ModelsClient 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 ModelsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ModelsClient. + /// 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 ModelsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.OptionsSupport.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.OptionsSupport.g.cs new file mode 100644 index 00000000..9825b45a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.OptionsSupport.g.cs @@ -0,0 +1,937 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Global defaults applied to generated SDK requests. + /// + public sealed class AutoSDKClientOptions + { + /// + /// Additional headers applied to every request after generated headers are set. + /// Entries with the same key overwrite earlier header values. + /// + public global::System.Collections.Generic.Dictionary Headers { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.OrdinalIgnoreCase); + + /// + /// Additional query parameters appended to every request. + /// Request-level entries with the same key are appended after client defaults. + /// + public global::System.Collections.Generic.Dictionary QueryParameters { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.Ordinal); + + /// + /// Optional timeout applied to the full request execution. + /// + public global::System.TimeSpan? Timeout { get; set; } + + /// + /// Default retry behavior for generated HTTP requests. + /// + public global::DeepInfra.AutoSDKRetryOptions Retry { get; set; } = new global::DeepInfra.AutoSDKRetryOptions(); + + /// + /// Overrides the client-wide response buffering mode when set. + /// + public bool? ReadResponseAsString { get; set; } + + /// + /// Reusable hooks invoked for every generated SDK request. + /// + public global::System.Collections.Generic.List Hooks { get; } = + new global::System.Collections.Generic.List(); + + /// + /// Registers a hook for all requests issued by this client. + /// + /// + /// The current options instance. + public global::DeepInfra.AutoSDKClientOptions AddHook( + global::DeepInfra.IAutoSDKHook hook) + { + Hooks.Add(hook ?? throw new global::System.ArgumentNullException(nameof(hook))); + return this; + } + + /// + /// Optional per-request authorization provider invoked before each request is sent. + /// Set this when the client is registered as a singleton in DI but each call needs + /// a fresh credential resolved from a provider, secret-store, or session — instead + /// of mutating the shared Authorizations list at construction time. + /// + public global::DeepInfra.IAutoSDKAuthorizationProvider? AuthorizationProvider { get; set; } + + /// + /// Convenience helper that registers + /// using so request-level auth is resolved without + /// touching shared client state. + /// + /// + public global::DeepInfra.AutoSDKClientOptions UseAuthorizationProvider( + global::DeepInfra.IAutoSDKAuthorizationProvider provider) + { + AuthorizationProvider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); + if (Hooks.Find(static x => x is global::DeepInfra.AutoSDKAuthorizationProviderHook) == null) + { + Hooks.Add(new global::DeepInfra.AutoSDKAuthorizationProviderHook()); + } + + return this; + } + } + + /// + /// A request-level authorization value supplied by . + /// Mirrors the runtime fields the SDK applies for HTTP / OAuth2 / API-key auth without + /// requiring the consumer to construct the generated EndPointAuthorization type. + /// + public readonly struct AutoSDKAuthorizationValue + { + /// + /// Initializes a new . + /// + /// + /// + /// + /// + /// + public AutoSDKAuthorizationValue( + string value, + string scheme = "Bearer", + string? headerName = null, + string location = "Header", + string type = "Http") + { + Value = value ?? string.Empty; + Scheme = string.IsNullOrWhiteSpace(scheme) ? "Bearer" : scheme; + HeaderName = headerName ?? string.Empty; + Location = string.IsNullOrWhiteSpace(location) ? "Header" : location; + Type = string.IsNullOrWhiteSpace(type) ? "Http" : type; + } + + /// The credential value (token, API key, etc.). + public string Value { get; } + + /// The HTTP authorization scheme — typically Bearer, Basic, or Token. + public string Scheme { get; } + + /// The custom header name when is ApiKey; ignored for HTTP/OAuth2 auth. + public string HeaderName { get; } + + /// The credential location — Header, Query, or Cookie. + public string Location { get; } + + /// The auth type — Http, OAuth2, OpenIdConnect, or ApiKey. + public string Type { get; } + + /// Convenience factory for a Bearer token. + public static global::DeepInfra.AutoSDKAuthorizationValue Bearer(string token) => new(value: token, scheme: "Bearer"); + + /// Convenience factory for an API-key header. + public static global::DeepInfra.AutoSDKAuthorizationValue ApiKeyHeader(string name, string value) => + new(value: value, headerName: name, location: "Header", type: "ApiKey"); + } + + /// + /// Resolves request-level authorization values without mutating the shared client + /// authorization list. Implementations should be safe to invoke concurrently — + /// the hook calls them once per outgoing request. + /// + public interface IAutoSDKAuthorizationProvider + { + /// + /// Returns one or more values to apply to + /// the current request, or an empty list / null to leave the request as-is. + /// + /// + global::System.Threading.Tasks.Task?> ResolveAsync( + global::DeepInfra.AutoSDKHookContext context); + } + + /// + /// Marker keys stamped onto outgoing + /// instances so consumer s — and any + /// other transport-layer code that runs after AutoSDK's send pipeline — can observe whether + /// the resolved Authorization is call-scoped and opt out of overwriting it with a + /// rotation-aware account-level credential. + /// + public static class AutoSDKHttpRequestOptions + { + /// + /// Key under which records the marker. Exposed + /// for handlers that target frameworks older than .NET 5 and need to read the value + /// through the legacy HttpRequestMessage.Properties bag. + /// + public const string AuthorizationOverrideKey = "AutoSDK.AuthorizationOverride"; + +#if NET5_0_OR_GREATER + /// + /// Strongly-typed for + /// the call-scoped Authorization marker on .NET 5+ targets. Consumers should prefer this + /// over the legacy HttpRequestMessage.Properties bag where available. + /// + public static readonly global::System.Net.Http.HttpRequestOptionsKey AuthorizationOverride = + new global::System.Net.Http.HttpRequestOptionsKey(AuthorizationOverrideKey); +#endif + + /// + /// Stamps the call-scoped Authorization marker on . AutoSDK's + /// built-in calls this whenever the + /// resolved auth came from a per-request override or a client-level + /// . Hand-written SDK extensions that set a + /// non-default Authorization header (e.g. a session-scoped bearer returned by an + /// upstream poll) should call this too so downstream rotation handlers know to skip the + /// overwrite. + /// + /// + public static void StampAuthorizationOverride( + global::System.Net.Http.HttpRequestMessage? request) + { + if (request is null) + { + return; + } + +#if NET5_0_OR_GREATER + request.Options.Set(AuthorizationOverride, true); +#else +#pragma warning disable CS0618 // HttpRequestMessage.Properties is obsolete in NET5+, but the only option below it. + request.Properties[AuthorizationOverrideKey] = true; +#pragma warning restore CS0618 +#endif + } + + /// + /// Returns true when previously marked the + /// request as carrying a call-scoped Authorization. + /// + /// + public static bool HasAuthorizationOverride( + global::System.Net.Http.HttpRequestMessage? request) + { + if (request is null) + { + return false; + } + +#if NET5_0_OR_GREATER + return request.Options.TryGetValue(AuthorizationOverride, out var value) && value; +#else +#pragma warning disable CS0618 + return request.Properties.TryGetValue(AuthorizationOverrideKey, out var raw) && + raw is bool flag && + flag; +#pragma warning restore CS0618 +#endif + } + } + + /// + /// Built-in that consults + /// before every outgoing + /// request and stamps the resolved values onto the . + /// + public sealed class AutoSDKAuthorizationProviderHook : global::DeepInfra.AutoSDKHook + { + /// + public override async global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::DeepInfra.AutoSDKHookContext context) + { + context = context ?? throw new global::System.ArgumentNullException(nameof(context)); + + if (context.Request == null) + { + return; + } + + var perRequest = context.RequestOptions?.Authorizations; + if (perRequest != null && perRequest.Count > 0) + { + for (var index = 0; index < perRequest.Count; index++) + { + ApplyAuthorization(context.Request, perRequest[index]); + } + + global::DeepInfra.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + return; + } + + var provider = context.ClientOptions?.AuthorizationProvider; + if (provider == null) + { + return; + } + + var resolved = await provider.ResolveAsync(context).ConfigureAwait(false); + if (resolved == null || resolved.Count == 0) + { + return; + } + + for (var index = 0; index < resolved.Count; index++) + { + ApplyAuthorization(context.Request, resolved[index]); + } + + global::DeepInfra.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + } + + private static void ApplyAuthorization( + global::System.Net.Http.HttpRequestMessage request, + global::DeepInfra.AutoSDKAuthorizationValue authorization) + { + switch (authorization.Type) + { + case "Http": + case "OAuth2": + case "OpenIdConnect": + request.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: authorization.Scheme, + parameter: authorization.Value); + break; + case "ApiKey": + if (string.Equals(authorization.Location, "Header", global::System.StringComparison.OrdinalIgnoreCase) && + !string.IsNullOrEmpty(authorization.HeaderName)) + { + request.Headers.Remove(authorization.HeaderName); + request.Headers.TryAddWithoutValidation(authorization.HeaderName, authorization.Value ?? string.Empty); + } + break; + } + } + } + + /// + /// Per-request overrides applied on top of . + /// + public sealed class AutoSDKRequestOptions + { + /// + /// Additional headers applied after generated and client-level headers. + /// + public global::System.Collections.Generic.Dictionary Headers { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.OrdinalIgnoreCase); + + /// + /// Additional query parameters appended after generated and client-level query parameters. + /// + public global::System.Collections.Generic.Dictionary QueryParameters { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.Ordinal); + + /// + /// Optional timeout override for this request. + /// + public global::System.TimeSpan? Timeout { get; set; } + + /// + /// Optional retry override for this request. + /// + public global::DeepInfra.AutoSDKRetryOptions? Retry { get; set; } + + /// + /// Overrides response buffering for this request when set. + /// + public bool? ReadResponseAsString { get; set; } + + /// + /// Optional per-request authorization values. When non-empty, the built-in + /// applies these instead of consulting + /// for this request only. + /// Useful for multi-tenant routing or "act-as" admin tooling that needs a different + /// credential per call without mutating shared client state. + /// + public global::System.Collections.Generic.IReadOnlyList? Authorizations { get; set; } + } + + /// + /// Retry settings for generated HTTP requests. + /// + public sealed class AutoSDKRetryOptions + { + /// + /// Total number of attempts, including the initial request. + /// Values less than 1 are normalized to 1. + /// + public int MaxAttempts { get; set; } = 1; + + /// + /// Optional fixed delay between retry attempts. When set, this takes precedence over exponential backoff. + /// + public global::System.TimeSpan? Delay { get; set; } + + /// + /// Initial exponential backoff delay used when is not set. + /// + public global::System.TimeSpan InitialDelay { get; set; } = global::System.TimeSpan.FromSeconds(1); + + /// + /// Maximum retry delay after applying retry headers, backoff, and jitter. + /// + public global::System.TimeSpan MaxDelay { get; set; } = global::System.TimeSpan.FromSeconds(30); + + /// + /// Multiplier applied to exponential backoff after each failed attempt. + /// Values below 1 are normalized to 1. + /// + public double BackoffMultiplier { get; set; } = 2D; + + /// + /// Randomizes computed backoff by plus or minus this ratio. Values are clamped to 0..1. + /// + public double JitterRatio { get; set; } = 0.2D; + + /// + /// Whether Retry-After response headers should control retry delay when present. + /// + public bool UseRetryAfterHeader { get; set; } = true; + + /// + /// Whether a rate-limit reset response header should control retry delay when present. + /// + public bool UseRateLimitResetHeader { get; set; } + + /// + /// Optional provider-specific rate-limit reset header name. Values may be Unix seconds or an HTTP date. + /// + public string? RateLimitResetHeaderName { get; set; } = "X-RateLimit-Reset"; + } + + + /// + /// Runtime hook interface for generated SDK lifecycle events. + /// + public interface IAutoSDKHook + { + /// + /// Runs before a request is sent. + /// + /// + global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::DeepInfra.AutoSDKHookContext context); + + /// + /// Runs after a successful HTTP response is received. + /// + /// + global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::DeepInfra.AutoSDKHookContext context); + + /// + /// Runs after an error response or transport failure is observed. + /// + /// + global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::DeepInfra.AutoSDKHookContext context); + } + + /// + /// Convenience base type for request hooks with no-op defaults. + /// + public abstract class AutoSDKHook : global::DeepInfra.IAutoSDKHook + { + /// + public virtual global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::DeepInfra.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + + /// + public virtual global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::DeepInfra.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + + /// + public virtual global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::DeepInfra.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + } + + /// + /// Runtime metadata passed to generated SDK hooks. + /// + public sealed class AutoSDKHookContext + { + /// + /// The source OpenAPI operation id or generated fallback id. + /// + public string OperationId { get; set; } = string.Empty; + + /// + /// The generated C# method name. + /// + public string MethodName { get; set; } = string.Empty; + + /// + /// The OpenAPI path template for the operation. + /// + public string PathTemplate { get; set; } = string.Empty; + + /// + /// The HTTP method used for the request. + /// + public string HttpMethod { get; set; } = string.Empty; + + /// + /// The client's resolved base URI. + /// + public global::System.Uri? BaseUri { get; set; } + + /// + /// The outgoing HTTP request for the current attempt. + /// + public global::System.Net.Http.HttpRequestMessage Request { get; set; } = null!; + + /// + /// The HTTP response when one was received. + /// + public global::System.Net.Http.HttpResponseMessage? Response { get; set; } + + /// + /// The transport or processing exception when one was observed. + /// + public global::System.Exception? Exception { get; set; } + + /// + /// The client-wide runtime options. + /// + public global::DeepInfra.AutoSDKClientOptions ClientOptions { get; set; } = null!; + + /// + /// The per-request runtime options. + /// + public global::DeepInfra.AutoSDKRequestOptions? RequestOptions { get; set; } + + /// + /// The current attempt number, starting at 1. + /// + public int Attempt { get; set; } + + /// + /// The total number of attempts allowed for this request. + /// + public int MaxAttempts { get; set; } + + /// + /// Indicates whether the generated client will retry after this hook invocation. + /// + public bool WillRetry { get; set; } + + /// + /// The computed retry delay when is true. + /// + public global::System.TimeSpan? RetryDelay { get; set; } + + /// + /// A short retry reason such as exception or status:429. + /// + public string RetryReason { get; set; } = string.Empty; + + /// + /// The effective cancellation token for the current request attempt. + /// + public global::System.Threading.CancellationToken CancellationToken { get; set; } + } + + + internal static class AutoSDKRequestOptionsSupport + { + internal static global::DeepInfra.AutoSDKHookContext CreateHookContext( + string operationId, + string methodName, + string pathTemplate, + string httpMethod, + global::System.Uri? baseUri, + global::System.Net.Http.HttpRequestMessage request, + global::System.Net.Http.HttpResponseMessage? response, + global::System.Exception? exception, + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKRequestOptions? requestOptions, + int attempt, + int maxAttempts, + bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, + global::System.Threading.CancellationToken cancellationToken) + { + return new global::DeepInfra.AutoSDKHookContext + { + OperationId = operationId ?? string.Empty, + MethodName = methodName ?? string.Empty, + PathTemplate = pathTemplate ?? string.Empty, + HttpMethod = httpMethod ?? string.Empty, + BaseUri = baseUri, + Request = request, + Response = response, + Exception = exception, + ClientOptions = clientOptions, + RequestOptions = requestOptions, + Attempt = attempt, + MaxAttempts = maxAttempts, + WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, + CancellationToken = cancellationToken, + }; + } + + internal static global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnBeforeRequestAsync(hookContext), context); + } + + internal static global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnAfterSuccessAsync(hookContext), context); + } + + internal static global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnAfterErrorAsync(hookContext), context); + } + + internal static bool GetReadResponseAsString( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKRequestOptions? requestOptions, + bool fallbackValue) + { + return requestOptions?.ReadResponseAsString ?? + clientOptions.ReadResponseAsString ?? + fallbackValue; + } + + internal static global::System.Threading.CancellationTokenSource? CreateTimeoutCancellationTokenSource( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKRequestOptions? requestOptions, + global::System.Threading.CancellationToken cancellationToken) + { + var timeout = requestOptions?.Timeout ?? clientOptions.Timeout; + if (!timeout.HasValue || timeout.Value <= global::System.TimeSpan.Zero) + { + return null; + } + + var cancellationTokenSource = global::System.Threading.CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + cancellationTokenSource.CancelAfter(timeout.Value); + return cancellationTokenSource; + } + + internal static int GetMaxAttempts( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKRequestOptions? requestOptions, + bool supportsRetry) + { + if (!supportsRetry) + { + return 1; + } + + var maxAttempts = requestOptions?.Retry?.MaxAttempts ?? + clientOptions.Retry?.MaxAttempts ?? + 1; + return maxAttempts < 1 ? 1 : maxAttempts; + } + + internal static global::System.TimeSpan GetRetryDelay( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::DeepInfra.AutoSDKRetryOptions(); + + if (retryOptions.UseRetryAfterHeader && + TryGetRetryAfterDelay(response, out var retryAfterDelay)) + { + return ClampRetryDelay(retryAfterDelay, retryOptions); + } + + if (retryOptions.UseRateLimitResetHeader && + TryGetRateLimitResetDelay(response, retryOptions.RateLimitResetHeaderName, out var rateLimitResetDelay)) + { + return ClampRetryDelay(rateLimitResetDelay, retryOptions); + } + + if (retryOptions.Delay.HasValue) + { + return ClampRetryDelay(retryOptions.Delay.Value, retryOptions); + } + + var initialDelay = retryOptions.InitialDelay; + if (initialDelay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var multiplier = retryOptions.BackoffMultiplier < 1D ? 1D : retryOptions.BackoffMultiplier; + var exponent = attempt <= 1 ? 0 : attempt - 1; + var delayMilliseconds = initialDelay.TotalMilliseconds * global::System.Math.Pow(multiplier, exponent); + if (double.IsNaN(delayMilliseconds) || double.IsInfinity(delayMilliseconds) || delayMilliseconds < 0D) + { + delayMilliseconds = 0D; + } + + var delay = global::System.TimeSpan.FromMilliseconds(delayMilliseconds); + delay = ApplyJitter(delay, retryOptions.JitterRatio); + return ClampRetryDelay(delay, retryOptions); + } + + internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::System.TimeSpan retryDelay, + global::System.Threading.CancellationToken cancellationToken) + { + if (retryDelay <= global::System.TimeSpan.Zero) + { + return; + } + + await global::System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); + } + + private static bool TryGetRetryAfterDelay( + global::System.Net.Http.HttpResponseMessage? response, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + var retryAfter = response?.Headers.RetryAfter; + if (retryAfter == null) + { + return false; + } + + if (retryAfter.Delta.HasValue) + { + delay = retryAfter.Delta.Value; + return delay > global::System.TimeSpan.Zero; + } + + if (retryAfter.Date.HasValue) + { + delay = retryAfter.Date.Value - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static bool TryGetRateLimitResetDelay( + global::System.Net.Http.HttpResponseMessage? response, + string? headerName, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + if (response == null || string.IsNullOrWhiteSpace(headerName)) + { + return false; + } + + if (!response.Headers.TryGetValues(headerName, out var values) && + (response.Content?.Headers == null || !response.Content.Headers.TryGetValues(headerName, out values))) + { + return false; + } + + var value = global::System.Linq.Enumerable.FirstOrDefault(values); + if (string.IsNullOrWhiteSpace(value)) + { + return false; + } + + value = value.Trim(); + if (long.TryParse( + value, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var unixSeconds)) + { + delay = global::System.DateTimeOffset.FromUnixTimeSeconds(unixSeconds) - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + if (global::System.DateTimeOffset.TryParse( + value, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var resetAt)) + { + delay = resetAt - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static global::System.TimeSpan ApplyJitter( + global::System.TimeSpan delay, + double jitterRatio) + { + if (delay <= global::System.TimeSpan.Zero || jitterRatio <= 0D) + { + return delay; + } + + if (jitterRatio > 1D) + { + jitterRatio = 1D; + } + + var sample = NextJitterSample(); + var multiplier = 1D - jitterRatio + (sample * jitterRatio * 2D); + var milliseconds = delay.TotalMilliseconds * multiplier; + if (double.IsNaN(milliseconds) || double.IsInfinity(milliseconds) || milliseconds < 0D) + { + milliseconds = 0D; + } + + return global::System.TimeSpan.FromMilliseconds(milliseconds); + } + + private static double NextJitterSample() + { + var bytes = new byte[8]; + using (var randomNumberGenerator = global::System.Security.Cryptography.RandomNumberGenerator.Create()) + { + randomNumberGenerator.GetBytes(bytes); + } + + var value = global::System.BitConverter.ToUInt64(bytes, 0); + return value / (double)ulong.MaxValue; + } + + private static global::System.TimeSpan ClampRetryDelay( + global::System.TimeSpan delay, + global::DeepInfra.AutoSDKRetryOptions retryOptions) + { + if (delay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var maxDelay = retryOptions.MaxDelay; + if (maxDelay > global::System.TimeSpan.Zero && delay > maxDelay) + { + return maxDelay; + } + + return delay; + } + + internal static bool ShouldRetryStatusCode( + global::System.Net.HttpStatusCode statusCode) + { + return (int)statusCode switch + { + 408 => true, + 429 => true, + 500 => true, + 502 => true, + 503 => true, + 504 => true, + _ => false, + }; + } + + internal static string AppendQueryParameters( + string path, + global::System.Collections.Generic.Dictionary clientParameters, + global::System.Collections.Generic.Dictionary? requestParameters) + { + var hasClientParameters = clientParameters != null && clientParameters.Count > 0; + var hasRequestParameters = requestParameters != null && requestParameters.Count > 0; + if (!hasClientParameters && !hasRequestParameters) + { + return path; + } + + var builder = new global::System.Text.StringBuilder(path ?? string.Empty); + var hasQuery = builder.ToString().IndexOf("?", global::System.StringComparison.Ordinal) >= 0; + AppendParameters(builder, clientParameters, ref hasQuery); + AppendParameters(builder, requestParameters, ref hasQuery); + return builder.ToString(); + } + + internal static void ApplyHeaders( + global::System.Net.Http.HttpRequestMessage request, + global::System.Collections.Generic.Dictionary clientHeaders, + global::System.Collections.Generic.Dictionary? requestHeaders) + { + ApplyHeadersCore(request, clientHeaders); + ApplyHeadersCore(request, requestHeaders); + } + + private static void AppendParameters( + global::System.Text.StringBuilder builder, + global::System.Collections.Generic.Dictionary? parameters, + ref bool hasQuery) + { + if (parameters == null || parameters.Count == 0) + { + return; + } + + foreach (var parameter in parameters) + { + builder.Append(hasQuery ? '&' : '?'); + builder.Append(global::System.Uri.EscapeDataString(parameter.Key)); + builder.Append('='); + builder.Append(global::System.Uri.EscapeDataString(parameter.Value ?? string.Empty)); + hasQuery = true; + } + } + + private static void ApplyHeadersCore( + global::System.Net.Http.HttpRequestMessage request, + global::System.Collections.Generic.Dictionary? headers) + { + if (headers == null || headers.Count == 0) + { + return; + } + + foreach (var header in headers) + { + request.Headers.Remove(header.Key); + request.Content?.Headers.Remove(header.Key); + + if (!request.Headers.TryAddWithoutValidation(header.Key, header.Value ?? string.Empty) && + request.Content != null) + { + request.Content.Headers.TryAddWithoutValidation(header.Key, header.Value ?? string.Empty); + } + } + } + + private static async global::System.Threading.Tasks.Task InvokeHooksAsync( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::System.Func callback, + global::DeepInfra.AutoSDKHookContext context) + { + if (clientOptions.Hooks == null || clientOptions.Hooks.Count == 0) + { + return; + } + + foreach (var hook in clientOptions.Hooks) + { + if (hook == null) + { + continue; + } + + await callback(hook, context).ConfigureAwait(false); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.PathBuilder.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.PathBuilder.g.cs index 5bb91371..ca3f8c0d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.PathBuilder.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.PathBuilder.g.cs @@ -224,6 +224,40 @@ public PathBuilder AddOptionalParameter( return this; } + /// + /// Adds a pre-serialized query string fragment to the URL. + /// + /// The serialized query string value. + /// The current instance. + public PathBuilder AddRawQueryString( + string value) + { + if (string.IsNullOrWhiteSpace(value)) + { + return this; + } + + value = value.TrimStart('?', '&'); + if (value.Length == 0) + { + return this; + } + + if (_firstParameter) + { + _stringBuilder.Append('?'); + _firstParameter = false; + } + else + { + _stringBuilder.Append('&'); + } + + _stringBuilder.Append(value); + + return this; + } + /// /// Returns the constructed URL as a string. /// @@ -241,6 +275,11 @@ public class EndPointAuthorization /// public string Type { get; set; } = string.Empty; + /// + /// + /// + public string SchemeId { get; set; } = string.Empty; + /// /// /// diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Polyfills.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Polyfills.g.cs index 92ad4e7f..b248dda1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Polyfills.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Polyfills.g.cs @@ -1,5 +1,4 @@ -#if !NET6_0_OR_GREATER #nullable enable namespace DeepInfra @@ -9,6 +8,7 @@ namespace DeepInfra /// public static partial class AutoSdkPolyfills { +#if !NET6_0_OR_GREATER /// /// /// @@ -48,6 +48,136 @@ public static partial class AutoSdkPolyfills content = content ?? throw new global::System.ArgumentNullException(nameof(content)); return content.ReadAsByteArrayAsync(); } +#endif + + /// + /// Creates a JSON request content instance. + /// +#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.Net.Http.HttpContent CreateJsonContent( + T inputValue, + string mediaType, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions) + { + if (string.IsNullOrWhiteSpace(mediaType)) + { + throw new global::System.ArgumentException("Media type is required.", nameof(mediaType)); + } + +#if NET5_0_OR_GREATER + return global::System.Net.Http.Json.JsonContent.Create( + inputValue: inputValue, + mediaType: new global::System.Net.Http.Headers.MediaTypeHeaderValue(mediaType), + options: jsonSerializerOptions); +#else + var json = global::System.Text.Json.JsonSerializer.Serialize(inputValue, jsonSerializerOptions); + var stringContent = new global::System.Net.Http.StringContent( + content: json, + encoding: global::System.Text.Encoding.UTF8); + stringContent.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(mediaType) + { + CharSet = global::System.Text.Encoding.UTF8.WebName, + }; + return stringContent; +#endif + } + + /// + /// Creates a JSON request content instance using a source-generated serializer context. + /// + public static global::System.Net.Http.HttpContent CreateJsonContent( + object? inputValue, + global::System.Type inputType, + string mediaType, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + inputType = inputType ?? throw new global::System.ArgumentNullException(nameof(inputType)); + jsonSerializerContext = jsonSerializerContext ?? throw new global::System.ArgumentNullException(nameof(jsonSerializerContext)); + + if (string.IsNullOrWhiteSpace(mediaType)) + { + throw new global::System.ArgumentException("Media type is required.", nameof(mediaType)); + } + +#if NET5_0_OR_GREATER + var jsonTypeInfo = jsonSerializerContext.GetTypeInfo(inputType) ?? + throw new global::System.InvalidOperationException($"No JsonTypeInfo registered for '{inputType}'."); + return global::System.Net.Http.Json.JsonContent.Create( + inputValue: inputValue, + jsonTypeInfo: jsonTypeInfo, + mediaType: new global::System.Net.Http.Headers.MediaTypeHeaderValue(mediaType)); +#else + var json = global::System.Text.Json.JsonSerializer.Serialize( + value: inputValue, + inputType: inputType, + jsonSerializerContext); + var stringContent = new global::System.Net.Http.StringContent( + content: json, + encoding: global::System.Text.Encoding.UTF8); + stringContent.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(mediaType) + { + CharSet = global::System.Text.Encoding.UTF8.WebName, + }; + return stringContent; +#endif + } + + /// + /// Reads JSON content into the specified type using serializer options. + /// +#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 async global::System.Threading.Tasks.Task ReadFromJsonAsync( + this global::System.Net.Http.HttpContent content, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions, + global::System.Threading.CancellationToken cancellationToken) + { + content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + +#if NET5_0_OR_GREATER + return await global::System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsync( + content, + jsonSerializerOptions, + cancellationToken).ConfigureAwait(false); +#else + using var stream = await AutoSdkPolyfills.ReadAsStreamAsync(content, cancellationToken).ConfigureAwait(false); + return await global::System.Text.Json.JsonSerializer.DeserializeAsync( + utf8Json: stream, + options: jsonSerializerOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); +#endif + } + + /// + /// Reads JSON content into the specified type using a source-generated serializer context. + /// + public static async global::System.Threading.Tasks.Task ReadFromJsonAsync( + this global::System.Net.Http.HttpContent content, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext, + global::System.Threading.CancellationToken cancellationToken) + { + content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + jsonSerializerContext = jsonSerializerContext ?? throw new global::System.ArgumentNullException(nameof(jsonSerializerContext)); + +#if NET5_0_OR_GREATER + return (T?)await global::System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsync( + content, + typeof(T), + jsonSerializerContext, + cancellationToken).ConfigureAwait(false); +#else + using var stream = await AutoSdkPolyfills.ReadAsStreamAsync(content, cancellationToken).ConfigureAwait(false); + return (T?)await global::System.Text.Json.JsonSerializer.DeserializeAsync( + utf8Json: stream, + returnType: typeof(T), + jsonSerializerContext, + cancellationToken: cancellationToken).ConfigureAwait(false); +#endif + } } } -#endif \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Security.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Security.g.cs new file mode 100644 index 00000000..9a71fbcc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Security.g.cs @@ -0,0 +1,158 @@ +#nullable enable + +namespace DeepInfra +{ + internal sealed class EndPointAuthorizationRequirement + { + internal string Type { get; set; } = string.Empty; + + internal string SchemeId { get; set; } = string.Empty; + + internal string Location { get; set; } = string.Empty; + + internal string Name { get; set; } = string.Empty; + + internal string FriendlyName { get; set; } = string.Empty; + } + + internal sealed class EndPointSecurityRequirement + { + internal global::System.Collections.Generic.IReadOnlyList Authorizations { get; set; } = + global::System.Array.Empty(); + } + + internal static class EndPointSecurityResolver + { + internal static global::System.Collections.Generic.List ResolveAuthorizations( + global::System.Collections.Generic.IReadOnlyList availableAuthorizations, + global::System.Collections.Generic.IReadOnlyList securityRequirements, + string operationName) + { + availableAuthorizations = availableAuthorizations ?? throw new global::System.ArgumentNullException(nameof(availableAuthorizations)); + securityRequirements = securityRequirements ?? throw new global::System.ArgumentNullException(nameof(securityRequirements)); + operationName = operationName ?? throw new global::System.ArgumentNullException(nameof(operationName)); + + if (securityRequirements.Count == 0) + { + return new global::System.Collections.Generic.List(); + } + + var allowsAnonymous = false; + + foreach (var requirement in securityRequirements) + { + if (requirement.Authorizations.Count == 0) + { + allowsAnonymous = true; + continue; + } + + var selected = new global::System.Collections.Generic.List(requirement.Authorizations.Count); + var satisfied = true; + + foreach (var requiredAuthorization in requirement.Authorizations) + { + var found = false; + + for (var i = 0; i < availableAuthorizations.Count; i++) + { + if (!Matches(availableAuthorizations[i], requiredAuthorization)) + { + continue; + } + + selected.Add(availableAuthorizations[i]); + found = true; + break; + } + + if (!found) + { + satisfied = false; + break; + } + } + + if (satisfied) + { + return selected; + } + } + + if (allowsAnonymous) + { + return new global::System.Collections.Generic.List(); + } + + throw new global::System.InvalidOperationException( + $"Operation '{operationName}' requires one of the configured security alternatives: {DescribeRequirements(securityRequirements)}."); + } + + private static bool Matches( + EndPointAuthorization availableAuthorization, + EndPointAuthorizationRequirement requiredAuthorization) + { + if (!string.Equals(availableAuthorization.Type, requiredAuthorization.Type, global::System.StringComparison.Ordinal)) + { + return false; + } + + return requiredAuthorization.Type switch + { + "OAuth2" => string.Equals( + availableAuthorization.SchemeId, + requiredAuthorization.SchemeId, + global::System.StringComparison.Ordinal), + "OpenIdConnect" => string.Equals( + availableAuthorization.SchemeId, + requiredAuthorization.SchemeId, + global::System.StringComparison.Ordinal), + "MutualTLS" => string.Equals( + availableAuthorization.SchemeId, + requiredAuthorization.SchemeId, + global::System.StringComparison.Ordinal), + "Http" => string.Equals( + availableAuthorization.Name, + requiredAuthorization.Name, + global::System.StringComparison.Ordinal), + "ApiKey" => string.Equals( + availableAuthorization.Location, + requiredAuthorization.Location, + global::System.StringComparison.Ordinal) && + string.Equals( + availableAuthorization.Name, + requiredAuthorization.Name, + global::System.StringComparison.Ordinal), + _ => string.Equals( + availableAuthorization.Location, + requiredAuthorization.Location, + global::System.StringComparison.Ordinal) && + string.Equals( + availableAuthorization.Name, + requiredAuthorization.Name, + global::System.StringComparison.Ordinal), + }; + } + + private static string DescribeRequirements( + global::System.Collections.Generic.IReadOnlyList securityRequirements) + { + var parts = new global::System.Collections.Generic.List(securityRequirements.Count); + + foreach (var requirement in securityRequirements) + { + if (requirement.Authorizations.Count == 0) + { + parts.Add("anonymous"); + continue; + } + + parts.Add(string.Join( + " + ", + global::System.Linq.Enumerable.Select(requirement.Authorizations, static x => x.FriendlyName))); + } + + return string.Join(" or ", parts); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.OpenaiCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.OpenaiCompletions.g.cs new file mode 100644 index 00000000..a103781a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.OpenaiCompletions.g.cs @@ -0,0 +1,646 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class TextCompletionsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenaiCompletionsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenaiCompletionsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenaiCompletionsSecurityRequirement0, + }; + partial void PrepareOpenaiCompletionsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xDeepinfraSource, + ref string? xiApiKey, + global::DeepInfra.OpenAICompletionsIn request); + partial void PrepareOpenaiCompletionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? xiApiKey, + global::DeepInfra.OpenAICompletionsIn request); + partial void ProcessOpenaiCompletionsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenaiCompletionsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openai Completions + /// + /// + /// + /// + /// 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 OpenaiCompletionsAsync( + + global::DeepInfra.OpenAICompletionsIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiCompletionsAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openai Completions + /// + /// + /// + /// + /// 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> OpenaiCompletionsAsResponseAsync( + + global::DeepInfra.OpenAICompletionsIn request, + string? xDeepinfraSource = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareOpenaiCompletionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenaiCompletionsSecurityRequirements, + operationName: "OpenaiCompletionsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/completions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xDeepinfraSource != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiCompletionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiCompletions", + methodName: "OpenaiCompletionsAsync", + pathTemplate: "\"/v1/completions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiCompletions", + methodName: "OpenaiCompletionsAsync", + pathTemplate: "\"/v1/completions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiCompletions", + methodName: "OpenaiCompletionsAsync", + pathTemplate: "\"/v1/completions\"", + 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::DeepInfra.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); + ProcessOpenaiCompletionsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiCompletions", + methodName: "OpenaiCompletionsAsync", + pathTemplate: "\"/v1/completions\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenaiCompletions", + methodName: "OpenaiCompletionsAsync", + pathTemplate: "\"/v1/completions\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessOpenaiCompletionsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Openai Completions + /// + /// + /// + /// + /// model name + /// + /// + /// input prompt - a single string is currently supported + /// + /// + /// The maximum number of tokens to generate in the completion.
+ /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. + /// + /// + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
+ /// Default Value: 1F + /// + /// + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
+ /// Default Value: 1F + /// + /// + /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
+ /// Default Value: 0F + /// + /// + /// Sample from the best k (number of) tokens. 0 means off
+ /// Default Value: 0 + /// + /// + /// number of sequences to return
+ /// Default Value: 1 + /// + /// + /// whether to stream the output via SSE or return the full response
+ /// Default Value: false + /// + /// + /// return top tokens and their log-probabilities + /// + /// + /// return prompt as part of the respons + /// + /// + /// up to 16 sequences where the API will stop generating further tokens + /// + /// + /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// The format of the response. Currently, only json is supported. + /// + /// + /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
+ /// Default Value: 1 + /// + /// + /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. + /// + /// + /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. + /// + /// + /// streaming options + /// + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + /// + /// return tokens as token ids + /// + /// + /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. + /// + /// + /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). + /// + /// 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 OpenaiCompletionsAsync( + string model, + global::DeepInfra.AnyOf> prompt, + string? xDeepinfraSource = default, + string? xiApiKey = default, + int? maxTokens = default, + double? temperature = default, + double? topP = default, + double? minP = default, + int? topK = default, + int? n = default, + bool? stream = default, + int? logprobs = default, + bool? echo = default, + global::DeepInfra.AnyOf, object>? stop = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::DeepInfra.AnyOf? responseFormat = default, + double? repetitionPenalty = default, + string? user = default, + int? seed = default, + global::DeepInfra.StreamOptions? streamOptions = default, + global::System.Collections.Generic.IList? stopTokenIds = default, + bool? returnTokensAsTokenIds = default, + string? promptCacheKey = default, + global::DeepInfra.CompletionMultiModalData? data = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAICompletionsIn + { + Model = model, + Prompt = prompt, + MaxTokens = maxTokens, + Temperature = temperature, + TopP = topP, + MinP = minP, + TopK = topK, + N = n, + Stream = stream, + Logprobs = logprobs, + Echo = echo, + Stop = stop, + PresencePenalty = presencePenalty, + FrequencyPenalty = frequencyPenalty, + ResponseFormat = responseFormat, + RepetitionPenalty = repetitionPenalty, + User = user, + Seed = seed, + StreamOptions = streamOptions, + StopTokenIds = stopTokenIds, + ReturnTokensAsTokenIds = returnTokensAsTokenIds, + PromptCacheKey = promptCacheKey, + Data = data, + }; + + return await OpenaiCompletionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.g.cs new file mode 100644 index 00000000..28b87560 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI-compatible text completion endpoints.
+ /// 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 TextCompletionsClient : global::DeepInfra.ITextCompletionsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the TextCompletionsClient. + /// 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 TextCompletionsClient( + 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 TextCompletionsClient 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 TextCompletionsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the TextCompletionsClient. + /// 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 TextCompletionsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.TextToSpeechClient.CreateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.CreateVoice.g.cs new file mode 100644 index 00000000..cd3ad572 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.CreateVoice.g.cs @@ -0,0 +1,1635 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class TextToSpeechClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateVoiceSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_CreateVoiceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateVoiceSecurityRequirement0, + }; + partial void PrepareCreateVoiceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request); + partial void PrepareCreateVoiceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request); + partial void ProcessCreateVoiceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateVoiceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Voice
+ /// Create a new voice + ///
+ /// + /// + /// 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 CreateVoiceAsync( + + global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateVoiceAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Voice
+ /// Create a new voice + ///
+ /// + /// + /// 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> CreateVoiceAsResponseAsync( + + global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateVoiceArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateVoiceSecurityRequirements, + operationName: "CreateVoiceAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/voices/add", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Description ?? string.Empty), + name: "\"description\""); + + for (var __iFiles = 0; __iFiles < request.Files.Count; __iFiles++) + { + var __contentFiles = new global::System.Net.Http.ByteArrayContent(request.Files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files\"", + fileName: $"\"file{__iFiles}.bin\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.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); + ProcessCreateVoiceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessCreateVoiceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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 Voice
+ /// Create a new voice + ///
+ /// + /// + /// + /// + /// 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 CreateVoiceAsync( + string name, + string description, + global::System.Collections.Generic.IList files, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.BodyCreateVoiceV1VoicesAddPost + { + Name = name, + Description = description, + Files = files, + }; + + return await CreateVoiceAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// Create Voice
+ /// Create a new voice + ///
+ /// + /// + /// + /// + /// The streams to send as multipart 'files' file parts. + /// + /// + /// Optional file names to use for the multipart 'files' file parts. + /// + /// 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 CreateVoiceAsync( + string name, + string description, + global::System.Collections.Generic.IReadOnlyList files, + string? xiApiKey = default, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + files = files ?? throw new global::System.ArgumentNullException(nameof(files)); + var request = new global::DeepInfra.BodyCreateVoiceV1VoicesAddPost + { + Name = name, + Description = description, + Files = new global::System.Collections.Generic.List(), + }; + PrepareArguments( + client: HttpClient); + PrepareCreateVoiceArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateVoiceSecurityRequirements, + operationName: "CreateVoiceAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/voices/add", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Description ?? string.Empty), + name: "\"description\""); + + for (var __iFiles = 0; __iFiles < files.Count; __iFiles++) + { + var __fileNameFiles = filesFileNames != null && + __iFiles < filesFileNames.Count && + filesFileNames[__iFiles] != null + ? filesFileNames[__iFiles] + : $"file{__iFiles}.bin"; + var __contentFiles = new global::System.Net.Http.StreamContent(files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFiles is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFiles) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files\"", + fileName: $"\"{__fileNameFiles}\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.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); + ProcessCreateVoiceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessCreateVoiceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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); + + return + await global::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + 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::DeepInfra.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 Voice
+ /// Create a new voice + ///
+ /// + /// + /// + /// + /// The streams to send as multipart 'files' file parts. + /// + /// + /// Optional file names to use for the multipart 'files' file parts. + /// + /// 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> CreateVoiceAsResponseAsync( + string name, + string description, + global::System.Collections.Generic.IReadOnlyList files, + string? xiApiKey = default, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + files = files ?? throw new global::System.ArgumentNullException(nameof(files)); + var request = new global::DeepInfra.BodyCreateVoiceV1VoicesAddPost + { + Name = name, + Description = description, + Files = new global::System.Collections.Generic.List(), + }; + PrepareArguments( + client: HttpClient); + PrepareCreateVoiceArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateVoiceSecurityRequirements, + operationName: "CreateVoiceAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/voices/add", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Description ?? string.Empty), + name: "\"description\""); + + for (var __iFiles = 0; __iFiles < files.Count; __iFiles++) + { + var __fileNameFiles = filesFileNames != null && + __iFiles < filesFileNames.Count && + filesFileNames[__iFiles] != null + ? filesFileNames[__iFiles] + : $"file{__iFiles}.bin"; + var __contentFiles = new global::System.Net.Http.StreamContent(files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFiles is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFiles) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files\"", + fileName: $"\"{__fileNameFiles}\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.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); + ProcessCreateVoiceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVoice", + methodName: "CreateVoiceAsync", + pathTemplate: "\"/v1/voices/add\"", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessCreateVoiceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.DeleteVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.DeleteVoice.g.cs new file mode 100644 index 00000000..c390a760 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.DeleteVoice.g.cs @@ -0,0 +1,546 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class TextToSpeechClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeleteVoiceSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeleteVoiceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeleteVoiceSecurityRequirement0, + }; + partial void PrepareDeleteVoiceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string voiceId, + ref string? xiApiKey); + partial void PrepareDeleteVoiceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string voiceId, + string? xiApiKey); + partial void ProcessDeleteVoiceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteVoiceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Voice + /// + /// + /// + /// 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 DeleteVoiceAsync( + string voiceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteVoiceAsResponseAsync( + voiceId: voiceId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Voice + /// + /// + /// + /// 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> DeleteVoiceAsResponseAsync( + string voiceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteVoiceArguments( + httpClient: HttpClient, + voiceId: ref voiceId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteVoiceSecurityRequirements, + operationName: "DeleteVoiceAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/voices/{voiceId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + voiceId: voiceId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteVoice", + methodName: "DeleteVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteVoice", + methodName: "DeleteVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteVoice", + methodName: "DeleteVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}\"", + httpMethod: "DELETE", + 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::DeepInfra.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); + ProcessDeleteVoiceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteVoice", + methodName: "DeleteVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}\"", + httpMethod: "DELETE", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteVoice", + methodName: "DeleteVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}\"", + httpMethod: "DELETE", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessDeleteVoiceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.GetVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.GetVoice.g.cs new file mode 100644 index 00000000..d1d7f6fd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.GetVoice.g.cs @@ -0,0 +1,515 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class TextToSpeechClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetVoiceSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetVoiceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetVoiceSecurityRequirement0, + }; + partial void PrepareGetVoiceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string voiceId, + ref string? xiApiKey); + partial void PrepareGetVoiceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string voiceId, + string? xiApiKey); + partial void ProcessGetVoiceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetVoiceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Voice
+ /// Get a voice by its id + ///
+ /// + /// + /// 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 GetVoiceAsync( + string voiceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVoiceAsResponseAsync( + voiceId: voiceId, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Voice
+ /// Get a voice by its id + ///
+ /// + /// + /// 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> GetVoiceAsResponseAsync( + string voiceId, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetVoiceArguments( + httpClient: HttpClient, + voiceId: ref voiceId, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetVoiceSecurityRequirements, + operationName: "GetVoiceAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/voices/{voiceId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + voiceId: voiceId!, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVoice", + methodName: "GetVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVoice", + methodName: "GetVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVoice", + methodName: "GetVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetVoiceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVoice", + methodName: "GetVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVoice", + methodName: "GetVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetVoiceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.GetVoices.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.GetVoices.g.cs new file mode 100644 index 00000000..94eb488e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.GetVoices.g.cs @@ -0,0 +1,506 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class TextToSpeechClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetVoicesSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetVoicesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetVoicesSecurityRequirement0, + }; + partial void PrepareGetVoicesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey); + partial void PrepareGetVoicesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey); + partial void ProcessGetVoicesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetVoicesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Voices
+ /// Get available voices for a given user + ///
+ /// + /// 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 GetVoicesAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVoicesAsResponseAsync( + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Voices
+ /// Get available voices for a given user + ///
+ /// + /// 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> GetVoicesAsResponseAsync( + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetVoicesArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetVoicesSecurityRequirements, + operationName: "GetVoicesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/voices", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetVoicesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVoices", + methodName: "GetVoicesAsync", + pathTemplate: "\"/v1/voices\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVoices", + methodName: "GetVoicesAsync", + pathTemplate: "\"/v1/voices\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVoices", + methodName: "GetVoicesAsync", + pathTemplate: "\"/v1/voices\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessGetVoicesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVoices", + methodName: "GetVoicesAsync", + pathTemplate: "\"/v1/voices\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVoices", + methodName: "GetVoicesAsync", + pathTemplate: "\"/v1/voices\"", + httpMethod: "GET", + 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); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessGetVoicesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.GetVoicesOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.GetVoicesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.TextToSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.TextToSpeech.g.cs new file mode 100644 index 00000000..a81206e6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.TextToSpeech.g.cs @@ -0,0 +1,554 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class TextToSpeechClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_TextToSpeechSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_TextToSpeechSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_TextToSpeechSecurityRequirement0, + }; + partial void PrepareTextToSpeechArguments( + global::System.Net.Http.HttpClient httpClient, + ref string voiceId, + ref string? outputFormat, + ref string? xiApiKey, + global::DeepInfra.ElevenLabsTextToSpeechIn request); + partial void PrepareTextToSpeechRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string voiceId, + string? outputFormat, + string? xiApiKey, + global::DeepInfra.ElevenLabsTextToSpeechIn request); + partial void ProcessTextToSpeechResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessTextToSpeechResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Text To Speech + /// + /// + /// + /// + /// + /// 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 TextToSpeechAsync( + string voiceId, + + global::DeepInfra.ElevenLabsTextToSpeechIn request, + string? outputFormat = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TextToSpeechAsResponseAsync( + voiceId: voiceId, + + request: request, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Text To Speech + /// + /// + /// + /// + /// + /// 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> TextToSpeechAsResponseAsync( + string voiceId, + + global::DeepInfra.ElevenLabsTextToSpeechIn request, + string? outputFormat = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareTextToSpeechArguments( + httpClient: HttpClient, + voiceId: ref voiceId, + outputFormat: ref outputFormat, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_TextToSpeechSecurityRequirements, + operationName: "TextToSpeechAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/text-to-speech/{voiceId}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("output_format", outputFormat) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareTextToSpeechRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + voiceId: voiceId!, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TextToSpeech", + methodName: "TextToSpeechAsync", + pathTemplate: "$\"/v1/text-to-speech/{voiceId}\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TextToSpeech", + methodName: "TextToSpeechAsync", + pathTemplate: "$\"/v1/text-to-speech/{voiceId}\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TextToSpeech", + methodName: "TextToSpeechAsync", + pathTemplate: "$\"/v1/text-to-speech/{voiceId}\"", + 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::DeepInfra.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); + ProcessTextToSpeechResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TextToSpeech", + methodName: "TextToSpeechAsync", + pathTemplate: "$\"/v1/text-to-speech/{voiceId}\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TextToSpeech", + methodName: "TextToSpeechAsync", + pathTemplate: "$\"/v1/text-to-speech/{voiceId}\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessTextToSpeechResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Text To Speech + /// + /// + /// + /// + /// + /// Text to convert to speech + /// + /// + /// Model ID to use for the conversion
+ /// Default Value: hexgrad/Kokoro-82M + /// + /// + /// Output format for the speech
+ /// Default Value: wav + /// + /// + /// ISO 639-1, 2 letter language code + /// + /// 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 TextToSpeechAsync( + string voiceId, + string text, + string? outputFormat = default, + string? xiApiKey = default, + string? modelId = default, + global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, + string? languageCode = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ElevenLabsTextToSpeechIn + { + Text = text, + ModelId = modelId, + OutputFormat = requestOutputFormat, + LanguageCode = languageCode, + }; + + return await TextToSpeechAsync( + voiceId: voiceId, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.TextToSpeechStream.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.TextToSpeechStream.g.cs new file mode 100644 index 00000000..cbcdba9e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.TextToSpeechStream.g.cs @@ -0,0 +1,554 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class TextToSpeechClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_TextToSpeechStreamSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_TextToSpeechStreamSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_TextToSpeechStreamSecurityRequirement0, + }; + partial void PrepareTextToSpeechStreamArguments( + global::System.Net.Http.HttpClient httpClient, + ref string voiceId, + ref string? outputFormat, + ref string? xiApiKey, + global::DeepInfra.ElevenLabsTextToSpeechIn request); + partial void PrepareTextToSpeechStreamRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string voiceId, + string? outputFormat, + string? xiApiKey, + global::DeepInfra.ElevenLabsTextToSpeechIn request); + partial void ProcessTextToSpeechStreamResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessTextToSpeechStreamResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Text To Speech Stream + /// + /// + /// + /// + /// + /// 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 TextToSpeechStreamAsync( + string voiceId, + + global::DeepInfra.ElevenLabsTextToSpeechIn request, + string? outputFormat = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TextToSpeechStreamAsResponseAsync( + voiceId: voiceId, + + request: request, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Text To Speech Stream + /// + /// + /// + /// + /// + /// 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> TextToSpeechStreamAsResponseAsync( + string voiceId, + + global::DeepInfra.ElevenLabsTextToSpeechIn request, + string? outputFormat = default, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareTextToSpeechStreamArguments( + httpClient: HttpClient, + voiceId: ref voiceId, + outputFormat: ref outputFormat, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_TextToSpeechStreamSecurityRequirements, + operationName: "TextToSpeechStreamAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/text-to-speech/{voiceId}/stream", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("output_format", outputFormat) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareTextToSpeechStreamRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + voiceId: voiceId!, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TextToSpeechStream", + methodName: "TextToSpeechStreamAsync", + pathTemplate: "$\"/v1/text-to-speech/{voiceId}/stream\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TextToSpeechStream", + methodName: "TextToSpeechStreamAsync", + pathTemplate: "$\"/v1/text-to-speech/{voiceId}/stream\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TextToSpeechStream", + methodName: "TextToSpeechStreamAsync", + pathTemplate: "$\"/v1/text-to-speech/{voiceId}/stream\"", + 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::DeepInfra.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); + ProcessTextToSpeechStreamResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TextToSpeechStream", + methodName: "TextToSpeechStreamAsync", + pathTemplate: "$\"/v1/text-to-speech/{voiceId}/stream\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TextToSpeechStream", + methodName: "TextToSpeechStreamAsync", + pathTemplate: "$\"/v1/text-to-speech/{voiceId}/stream\"", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessTextToSpeechStreamResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Text To Speech Stream + /// + /// + /// + /// + /// + /// Text to convert to speech + /// + /// + /// Model ID to use for the conversion
+ /// Default Value: hexgrad/Kokoro-82M + /// + /// + /// Output format for the speech
+ /// Default Value: wav + /// + /// + /// ISO 639-1, 2 letter language code + /// + /// 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 TextToSpeechStreamAsync( + string voiceId, + string text, + string? outputFormat = default, + string? xiApiKey = default, + string? modelId = default, + global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, + string? languageCode = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ElevenLabsTextToSpeechIn + { + Text = text, + ModelId = modelId, + OutputFormat = requestOutputFormat, + LanguageCode = languageCode, + }; + + return await TextToSpeechStreamAsync( + voiceId: voiceId, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.UpdateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.UpdateVoice.g.cs new file mode 100644 index 00000000..f185e16b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.UpdateVoice.g.cs @@ -0,0 +1,601 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class TextToSpeechClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UpdateVoiceSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UpdateVoiceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UpdateVoiceSecurityRequirement0, + }; + partial void PrepareUpdateVoiceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string voiceId, + ref string? xiApiKey, + global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request); + partial void PrepareUpdateVoiceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string voiceId, + string? xiApiKey, + global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request); + partial void ProcessUpdateVoiceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUpdateVoiceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update Voice + /// + /// + /// + /// + /// 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 UpdateVoiceAsync( + string voiceId, + + global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateVoiceAsResponseAsync( + voiceId: voiceId, + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Voice + /// + /// + /// + /// + /// 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> UpdateVoiceAsResponseAsync( + string voiceId, + + global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUpdateVoiceArguments( + httpClient: HttpClient, + voiceId: ref voiceId, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateVoiceSecurityRequirements, + operationName: "UpdateVoiceAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/voices/{voiceId}/edit", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/x-www-form-urlencoded"); + __httpRequest.Content = __httpRequestContent; + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + voiceId: voiceId!, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateVoice", + methodName: "UpdateVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}/edit\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateVoice", + methodName: "UpdateVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}/edit\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateVoice", + methodName: "UpdateVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}/edit\"", + 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::DeepInfra.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); + ProcessUpdateVoiceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateVoice", + methodName: "UpdateVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}/edit\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateVoice", + methodName: "UpdateVoiceAsync", + pathTemplate: "$\"/v1/voices/{voiceId}/edit\"", + 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); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessUpdateVoiceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.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::DeepInfra.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(); + } + } + /// + /// Update Voice + /// + /// + /// + /// + /// + /// 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 UpdateVoiceAsync( + string voiceId, + string name, + string description, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost + { + Name = name, + Description = description, + }; + + return await UpdateVoiceAsync( + voiceId: voiceId, + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.g.cs new file mode 100644 index 00000000..38b73a24 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// ElevenLabs-compatible TTS endpoints and voice management.
+ /// 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 TextToSpeechClient : global::DeepInfra.ITextToSpeechClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the TextToSpeechClient. + /// 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 TextToSpeechClient( + 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 TextToSpeechClient 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 TextToSpeechClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the TextToSpeechClient. + /// 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 TextToSpeechClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/DeepInfra.UtilitiesClient.CliVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.CliVersion.g.cs new file mode 100644 index 00000000..3a76e68d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.CliVersion.g.cs @@ -0,0 +1,460 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class UtilitiesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CliVersionSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_CliVersionSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CliVersionSecurityRequirement0, + }; + partial void PrepareCliVersionArguments( + global::System.Net.Http.HttpClient httpClient, + ref string version); + partial void PrepareCliVersionRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string version); + partial void ProcessCliVersionResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCliVersionResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Cli Version + /// + /// + /// 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 CliVersionAsync( + string version, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CliVersionAsResponseAsync( + version: version, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cli Version + /// + /// + /// 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> CliVersionAsResponseAsync( + string version, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCliVersionArguments( + httpClient: HttpClient, + version: ref version); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CliVersionSecurityRequirements, + operationName: "CliVersionAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/cli/version", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("version", version) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + 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); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCliVersionRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + version: version!); + + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CliVersion", + methodName: "CliVersionAsync", + pathTemplate: "\"/cli/version\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CliVersion", + methodName: "CliVersionAsync", + pathTemplate: "\"/cli/version\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CliVersion", + methodName: "CliVersionAsync", + pathTemplate: "\"/cli/version\"", + httpMethod: "GET", + 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::DeepInfra.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); + ProcessCliVersionResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CliVersion", + methodName: "CliVersionAsync", + pathTemplate: "\"/cli/version\"", + httpMethod: "GET", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CliVersion", + methodName: "CliVersionAsync", + pathTemplate: "\"/cli/version\"", + httpMethod: "GET", + 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); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessCliVersionResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.SubmitFeedback.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.SubmitFeedback.g.cs new file mode 100644 index 00000000..e9b12a2a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.SubmitFeedback.g.cs @@ -0,0 +1,555 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class UtilitiesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_SubmitFeedbackSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_SubmitFeedbackSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_SubmitFeedbackSecurityRequirement0, + }; + partial void PrepareSubmitFeedbackArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + global::DeepInfra.FeedbackIn request); + partial void PrepareSubmitFeedbackRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + global::DeepInfra.FeedbackIn request); + partial void ProcessSubmitFeedbackResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessSubmitFeedbackResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Submit Feedback
+ /// Submit feedback + ///
+ /// + /// + /// 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 SubmitFeedbackAsync( + + global::DeepInfra.FeedbackIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SubmitFeedbackAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Submit Feedback
+ /// Submit feedback + ///
+ /// + /// + /// 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> SubmitFeedbackAsResponseAsync( + + global::DeepInfra.FeedbackIn request, + string? xiApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareSubmitFeedbackArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SubmitFeedbackSecurityRequirements, + operationName: "SubmitFeedbackAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/feedback", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + + 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::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSubmitFeedbackRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SubmitFeedback", + methodName: "SubmitFeedbackAsync", + pathTemplate: "\"/v1/feedback\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SubmitFeedback", + methodName: "SubmitFeedbackAsync", + pathTemplate: "\"/v1/feedback\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SubmitFeedback", + methodName: "SubmitFeedbackAsync", + pathTemplate: "\"/v1/feedback\"", + 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::DeepInfra.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); + ProcessSubmitFeedbackResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SubmitFeedback", + methodName: "SubmitFeedbackAsync", + pathTemplate: "\"/v1/feedback\"", + 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::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SubmitFeedback", + methodName: "SubmitFeedbackAsync", + pathTemplate: "\"/v1/feedback\"", + 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); + } + // Forbidden + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::DeepInfra.DeepError? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::DeepInfra.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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + 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); + ProcessSubmitFeedbackResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.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(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + 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::DeepInfra.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(); + } + } + /// + /// Submit Feedback
+ /// Submit feedback + ///
+ /// + /// + /// The message you'd like to send to deepinfra team + /// + /// + /// Optional contact email to reach you back + /// + /// 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 SubmitFeedbackAsync( + string message, + string? xiApiKey = default, + string? contactEmail = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.FeedbackIn + { + Message = message, + ContactEmail = contactEmail, + }; + + return await SubmitFeedbackAsync( + xiApiKey: xiApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.g.cs new file mode 100644 index 00000000..11b10bd7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Feedback submission and CLI version.
+ /// 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 UtilitiesClient : global::DeepInfra.IUtilitiesClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the UtilitiesClient. + /// 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 UtilitiesClient( + 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 UtilitiesClient 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 UtilitiesClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the UtilitiesClient. + /// 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 UtilitiesClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.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::DeepInfra.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/DeepInfra/Generated/autosdk.generated-examples.json b/src/libs/DeepInfra/Generated/autosdk.generated-examples.json new file mode 100644 index 00000000..f206f0db --- /dev/null +++ b/src/libs/DeepInfra/Generated/autosdk.generated-examples.json @@ -0,0 +1,26 @@ +{ + "Examples": [ + { + "Order": 1, + "Title": "Text To Speech", + "Slug": "text-to-speech-v1-text-to-speech-voice-id-post", + "Description": "Generated from OpenAPI examples.", + "Language": "http", + "Code": "### Text To Speech\n# @name text_to_speech_v1_text_to_speech__voice_id__post\nPOST {{host}}/v1/text-to-speech/{{voice_id}}?output_format=wav\nAuthorization: Bearer {{token}}\nxi-api-key: {{xi-api-key}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022text\u0022: \u0022string\u0022,\n \u0022model_id\u0022: \u0022hexgrad/Kokoro-82M\u0022,\n \u0022output_format\u0022: \u0022wav\u0022,\n \u0022language_code\u0022: \u0022string\u0022\n}\n\n## Responses\n# 200\n# Description: Successful Response\n# Content-Type: application/json\n# 422\n# Description: Validation Error\n# Content-Type: application/json", + "Format": "http", + "OperationId": "text_to_speech_v1_text_to_speech__voice_id__post", + "Setup": null + }, + { + "Order": 2, + "Title": "Text To Speech Stream", + "Slug": "text-to-speech-stream-v1-text-to-speech-voice-id-stream-post", + "Description": "Generated from OpenAPI examples.", + "Language": "http", + "Code": "### Text To Speech Stream\n# @name text_to_speech_stream_v1_text_to_speech__voice_id__stream_post\nPOST {{host}}/v1/text-to-speech/{{voice_id}}/stream?output_format=wav\nAuthorization: Bearer {{token}}\nxi-api-key: {{xi-api-key}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022text\u0022: \u0022string\u0022,\n \u0022model_id\u0022: \u0022hexgrad/Kokoro-82M\u0022,\n \u0022output_format\u0022: \u0022wav\u0022,\n \u0022language_code\u0022: \u0022string\u0022\n}\n\n## Responses\n# 200\n# Description: Successful Response\n# Content-Type: application/json\n# 422\n# Description: Validation Error\n# Content-Type: application/json", + "Format": "http", + "OperationId": "text_to_speech_stream_v1_text_to_speech__voice_id__stream_post", + "Setup": null + } + ] +} \ No newline at end of file diff --git a/src/libs/DeepInfra/openapi.json b/src/libs/DeepInfra/openapi.json index bdc8a132..27a45fed 100644 --- a/src/libs/DeepInfra/openapi.json +++ b/src/libs/DeepInfra/openapi.json @@ -1 +1 @@ -{"openapi":"3.1.0","info":{"title":"DeepApi","version":"0.1.0"},"paths":{"/v1/metrics/live":{"get":{"summary":"Get Live Metrics","description":"Get the latest values for the Live metrics section on the web front page.","operationId":"get_live_metrics_v1_metrics_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebLiveMetricsOut"}}}}}}},"/cli/version":{"get":{"summary":"Cli Version","operationId":"cli_version_cli_version_get","parameters":[{"name":"version","in":"query","required":true,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me":{"get":{"summary":"Me","operationId":"me_v1_me_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"checklist","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Checklist"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Account","operationId":"delete_account_v1_me_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Account Update Details","operationId":"account_update_details_v1_me_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"}}}},"/v1/me/emails":{"get":{"summary":"Account Email Values","operationId":"account_email_values_v1_me_emails_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailsOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/team_display_name":{"post":{"summary":"Team Set Display Name","operationId":"team_set_display_name_v1_me_team_display_name_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisplayNameIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/rate_limit":{"get":{"summary":"Account Rate Limit","operationId":"account_rate_limit_v1_me_rate_limit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/rate_limit/request":{"post":{"summary":"Request Rate Limit Increase","operationId":"request_rate_limit_increase_v1_me_rate_limit_request_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitRequestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/deploy":{"post":{"summary":"Deploy Create","operationId":"deploy_create_v1_deploy_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployModelIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployResult"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Locked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/gpu_limit":{"get":{"summary":"Account Gpu Limit","operationId":"account_gpu_limit_v1_me_gpu_limit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpuLimitOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/gpu_limit/request":{"post":{"summary":"Request Gpu Limit Increase","operationId":"request_gpu_limit_increase_v1_me_gpu_limit_request_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpuLimitRequestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/hf/":{"post":{"summary":"Deploy Create Hf","operationId":"deploy_create_hf_deploy_hf__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HFModel"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployResult"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Locked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/llm/gpu_availability":{"get":{"summary":"Deploy Gpu Availability","operationId":"deploy_gpu_availability_deploy_llm_gpu_availability_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source","in":"query","required":false,"schema":{"type":"string","default":"","title":"Source"}},{"name":"base_model","in":"query","required":false,"schema":{"type":"string","default":"","title":"Base Model"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployGPUAvailability"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/llm":{"post":{"summary":"Deploy Create Llm","operationId":"deploy_create_llm_deploy_llm_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployLLMIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentOut"}}}},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Payment Required"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"}}}},"/deploy/list/":{"get":{"summary":"Deploy List","operationId":"deploy_list_deploy_list__get","deprecated":true,"security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted","title":"Status"},"description":"A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentOut"},"title":"Response Deploy List Deploy List Get"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/list":{"get":{"summary":"Deploy List","operationId":"deploy_list_deploy_list_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted","title":"Status"},"description":"A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentOut"},"title":"Response Deploy List Deploy List Get"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/stats":{"get":{"summary":"Deployment Stats","operationId":"deployment_stats_deploy_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)","title":"From"},"description":"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)"},{"name":"to","in":"query","required":false,"schema":{"type":"string","description":"end of period, unix ts or now-relative, check from, defaults to now","default":"now","title":"To"},"description":"end of period, unix ts or now-relative, check from, defaults to now"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentMainStatsOut"},"title":"Response Deployment Stats Deploy Stats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}":{"get":{"summary":"Deploy Status","operationId":"deploy_status_deploy__deploy_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Deploy Update","operationId":"deploy_update_deploy__deploy_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployLLMUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployStatusOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Deploy Delete","operationId":"deploy_delete_deploy__deploy_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployDelete"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}/stats":{"get":{"summary":"Deploy Stats","operationId":"deploy_stats_deploy__deploy_id__stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)","title":"From"},"description":"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)"},{"name":"to","in":"query","required":false,"schema":{"type":"string","description":"end of period, unix ts or now-relative, check from, defaults to now","default":"now","title":"To"},"description":"end of period, unix ts or now-relative, check from, defaults to now"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentStatsOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Gone"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}/stats2":{"get":{"summary":"Deploy Detailed Stats","operationId":"deploy_detailed_stats_deploy__deploy_id__stats2_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period, unix ts or 'now-5h', supported units s, m, h, d, w","title":"From"},"description":"start of period, unix ts or 'now-5h', supported units s, m, h, d, w"},{"name":"to","in":"query","required":false,"schema":{"type":"string","description":"end of period, unix ts or now-relative, check from, defaults to now","default":"now","title":"To"},"description":"end of period, unix ts or now-relative, check from, defaults to now"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetailedDeploymentStatsOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Gone"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}/stop":{"post":{"summary":"Deploy Stop","description":"Stop a running deployment. Terminates pods. Can be restarted later.","operationId":"deploy_stop_deploy__deploy_id__stop_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployStatusOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}/start":{"post":{"summary":"Deploy Start","description":"Start a stopped deployment. Re-creates pods via auto-scaling.","operationId":"deploy_start_deploy__deploy_id__start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployStatusOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/private/list":{"get":{"summary":"Private Models List","operationId":"private_models_list_models_private_list_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelOut"},"title":"Response Private Models List Models Private List Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lora-model":{"post":{"summary":"Upload Lora Model","operationId":"upload_lora_model_lora_model_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoraModelUploadIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lora-model/{lora_model_name}":{"delete":{"summary":"Delete Lora Model","operationId":"delete_lora_model_lora_model__lora_model_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lora_model_name","in":"path","required":true,"schema":{"type":"string","title":"Lora Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/model-families/names":{"get":{"summary":"Model Families Names","operationId":"model_families_names_model_families_names_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response Model Families Names Model Families Names Get"}}}}}}},"/model-families/{family_name}":{"get":{"summary":"Model Family","operationId":"model_family_model_families__family_name__get","parameters":[{"name":"family_name","in":"path","required":true,"schema":{"type":"string","title":"Family Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelFamilyOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/list":{"get":{"summary":"Models List","operationId":"models_list_models_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ModelOut"},"type":"array","title":"Response Models List Models List Get"}}}}}}},"/models/deployment/list":{"get":{"summary":"Models Deployment List","operationId":"models_deployment_list_models_deployment_list_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelOut"},"title":"Response Models Deployment List Models Deployment List Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/lora/list":{"get":{"summary":"Models Lora List","operationId":"models_lora_list_models_lora_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ModelOut"},"type":"array","title":"Response Models Lora List Models Lora List Get"}}}}}}},"/openrouter/models":{"get":{"summary":"Openrouter Models","operationId":"openrouter_models_openrouter_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenRouterModelsOut"}}}}}}},"/models/{model_name}/versions":{"get":{"summary":"Model Versions","operationId":"model_versions_models__model_name__versions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelVersionOut"},"title":"Response Model Versions Models Model Name Versions Get"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/{model_name}/publicity":{"post":{"summary":"Model Publicity","operationId":"model_publicity_models__model_name__publicity_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelPublicityIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/{model_name}/meta":{"post":{"summary":"Model Meta Update","operationId":"model_meta_update_models__model_name__meta_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelMetaIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/{model_name}":{"delete":{"summary":"Model Delete","operationId":"model_delete_models__model_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"version","in":"query","required":true,"schema":{"type":"string","description":"delete a particular version, pass 'ALL' to wipe everything","title":"Version"},"description":"delete a particular version, pass 'ALL' to wipe everything"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Models Info","operationId":"models_info_models__model_name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelInfoOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/featured":{"get":{"summary":"Models Featured","operationId":"models_featured_models_featured_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ModelOut"},"type":"array","title":"Response Models Featured Models Featured Get"}}}}}}},"/models/{model_name}/schema/{variantKey}":{"get":{"summary":"Model Schema","operationId":"model_schema_models__model_name__schema__variantKey__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"variantKey","in":"path","required":true,"schema":{"$ref":"#/components/schemas/SchemaVariantKey"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaOut"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Locked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inference/deploy/{deploy_id}":{"post":{"summary":"Inference Deploy","operationId":"inference_deploy_v1_inference_deploy__deploy_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inference/{model_name}":{"post":{"summary":"Inference Model","operationId":"inference_model_v1_inference__model_name__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"model version to run inference against","title":"Version"},"description":"model version to run inference against"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Locked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/completions":{"post":{"summary":"Openai Completions","operationId":"openai_completions_v1_completions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAICompletionsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/completions":{"post":{"summary":"Openai Completions","operationId":"openai_completions_v1_openai_completions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAICompletionsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/files":{"get":{"summary":"List Files","operationId":"list_files_v1_files_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"purpose","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"}},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Openai Files","operationId":"openai_files_v1_files_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_files_v1_files_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/files":{"get":{"summary":"List Files","operationId":"list_files_v1_openai_files_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"purpose","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"}},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Openai Files","operationId":"openai_files_v1_openai_files_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_files_v1_openai_files_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/batches":{"get":{"summary":"Retrieve Openai Batches","operationId":"retrieve_openai_batches_v1_batches_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"after","in":"query","required":true,"schema":{"type":"string","title":"After"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Openai Batch","operationId":"create_openai_batch_v1_batches_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIBatchesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIBatch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/batches":{"get":{"summary":"Retrieve Openai Batches","operationId":"retrieve_openai_batches_v1_openai_batches_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"after","in":"query","required":true,"schema":{"type":"string","title":"After"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Openai Batch","operationId":"create_openai_batch_v1_openai_batches_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIBatchesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIBatch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/batches/{batch_id}":{"get":{"summary":"Retrieve Openai Batch","operationId":"retrieve_openai_batch_v1_batches__batch_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/batches/{batch_id}":{"get":{"summary":"Retrieve Openai Batch","operationId":"retrieve_openai_batch_v1_openai_batches__batch_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/completions":{"post":{"summary":"Openai Chat Completions","operationId":"openai_chat_completions_v1_chat_completions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIChatCompletionsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/chat/completions":{"post":{"summary":"Openai Chat Completions","operationId":"openai_chat_completions_v1_openai_chat_completions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIChatCompletionsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anthropic/v1/messages":{"post":{"summary":"Anthropic Messages","operationId":"anthropic_messages_anthropic_v1_messages_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"anthropic-version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anthropic-Version"}},{"name":"anthropic-beta","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anthropic-Beta"}},{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessagesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anthropic/v1/messages/count_tokens":{"post":{"summary":"Anthropic Messages Count Tokens","operationId":"anthropic_messages_count_tokens_anthropic_v1_messages_count_tokens_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicTokenCountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/embeddings":{"post":{"summary":"Openai Embeddings","operationId":"openai_embeddings_v1_embeddings_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"user-agent","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Agent"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIEmbeddingsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/embeddings":{"post":{"summary":"Openai Embeddings","operationId":"openai_embeddings_v1_openai_embeddings_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"user-agent","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Agent"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIEmbeddingsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models":{"get":{"summary":"Openai Models","operationId":"openai_models_v1_models_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIModelsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/models":{"get":{"summary":"Openai Models","operationId":"openai_models_v1_openai_models_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIModelsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/images/generations":{"post":{"summary":"Openai Images Generations","description":"Generate image using OpenAI Images API","operationId":"openai_images_generations_v1_images_generations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesGenerationsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/images/generations":{"post":{"summary":"Openai Images Generations","description":"Generate image using OpenAI Images API","operationId":"openai_images_generations_v1_openai_images_generations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesGenerationsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/images/variations":{"post":{"summary":"Openai Images Variations","description":"Generate a similar image using OpenAI Images Variations API","operationId":"openai_images_variations_v1_images_variations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_images_variations_v1_images_variations_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/images/variations":{"post":{"summary":"Openai Images Variations","description":"Generate a similar image using OpenAI Images Variations API","operationId":"openai_images_variations_v1_openai_images_variations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_images_variations_v1_openai_images_variations_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/images/edits":{"post":{"summary":"Openai Images Edits","description":"Edit image using OpenAI Images Edits API","operationId":"openai_images_edits_v1_images_edits_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_images_edits_v1_images_edits_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/images/edits":{"post":{"summary":"Openai Images Edits","description":"Edit image using OpenAI Images Edits API","operationId":"openai_images_edits_v1_openai_images_edits_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_images_edits_v1_openai_images_edits_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/feedback":{"post":{"summary":"Submit Feedback","description":"Submit feedback","operationId":"submit_feedback_v1_feedback_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audio/speech":{"post":{"summary":"Openai Audio Speech","operationId":"openai_audio_speech_v1_audio_speech_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAITextToSpeechIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/audio/speech":{"post":{"summary":"Openai Audio Speech","operationId":"openai_audio_speech_v1_openai_audio_speech_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAITextToSpeechIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audio/transcriptions":{"post":{"summary":"Openai Audio Transcriptions","operationId":"openai_audio_transcriptions_v1_audio_transcriptions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_audio_transcriptions_v1_audio_transcriptions_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/audio/transcriptions":{"post":{"summary":"Openai Audio Transcriptions","operationId":"openai_audio_transcriptions_v1_openai_audio_transcriptions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_audio_transcriptions_v1_openai_audio_transcriptions_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audio/translations":{"post":{"summary":"Openai Audio Translations","operationId":"openai_audio_translations_v1_audio_translations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_audio_translations_v1_audio_translations_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/audio/translations":{"post":{"summary":"Openai Audio Translations","operationId":"openai_audio_translations_v1_openai_audio_translations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_audio_translations_v1_openai_audio_translations_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/logs/query":{"get":{"summary":"Logs Query","description":"Query inference logs.\n* Without timestamps (from/to) returns last `limit` messages (in last month).\n* With `from` only, returns first `limit` messages after `from` (inclusive).\n* With `to` only, returns last `limit` messages before `to` (inclusive).\n* With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.\n* `from` and `to` should be no more than a month apart.","operationId":"logs_query_v1_logs_query_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"query","required":true,"schema":{"type":"string","description":"the deploy id to get the logs from","title":"Deploy Id"},"description":"the deploy id to get the logs from"},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"start of period, in fractional seconds since unix epoch (inclusive)","title":"From"},"description":"start of period, in fractional seconds since unix epoch (inclusive)"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"end of period, in fractional seconds since unix epoch (exclusive)","title":"To"},"description":"end of period, in fractional seconds since unix epoch (exclusive)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"how many items to return at most (default 100, in [1, 1000])","default":100,"title":"Limit"},"description":"how many items to return at most (default 100, in [1, 1000])"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogQueryOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/deployment_logs/query":{"get":{"summary":"Deployment Logs Query","description":"Query deployment logs.\n* Without timestamps (from/to) returns last `limit` messages (in last month).\n* With `from` only, returns first `limit` messages after `from` (inclusive).\n* With `to` only, returns last `limit` messages before `to` (inclusive).\n* With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.\n* `from` and `to` should be no more than a month apart.","operationId":"deployment_logs_query_v1_deployment_logs_query_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"query","required":true,"schema":{"type":"string","description":"the deploy id to get the logs from","title":"Deploy Id"},"description":"the deploy id to get the logs from"},{"name":"pod_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"the pod name to get the logs from","title":"Pod Name"},"description":"the pod name to get the logs from"},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"start of period, in fractional seconds since unix epoch (inclusive)","title":"From"},"description":"start of period, in fractional seconds since unix epoch (inclusive)"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"end of period, in fractional seconds since unix epoch (exclusive)","title":"To"},"description":"end of period, in fractional seconds since unix epoch (exclusive)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"how many items to return at most (default 100, in [1, 1000])","default":100,"title":"Limit"},"description":"how many items to return at most (default 100, in [1, 1000])"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentLogQueryOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voices":{"get":{"summary":"Get Voices","description":"Get available voices for a given user","operationId":"get_voices_v1_voices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVoicesOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/text-to-speech/{voice_id}/stream":{"post":{"summary":"Text To Speech Stream","operationId":"text_to_speech_stream_v1_text_to_speech__voice_id__stream_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"name":"output_format","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Format"},"example":"wav"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElevenLabsTextToSpeechIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/text-to-speech/{voice_id}":{"post":{"summary":"Text To Speech","operationId":"text_to_speech_v1_text_to_speech__voice_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"name":"output_format","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Format"},"example":"wav"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElevenLabsTextToSpeechIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voices/{voice_id}":{"get":{"summary":"Get Voice","description":"Get a voice by its id","operationId":"get_voice_v1_voices__voice_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Voice"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Voice","operationId":"delete_voice_v1_voices__voice_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voices/add":{"post":{"summary":"Create Voice","description":"Create a new voice","operationId":"create_voice_v1_voices_add_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_voice_v1_voices_add_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Voice"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voices/{voice_id}/edit":{"post":{"summary":"Update Voice","operationId":"update_voice_v1_voices__voice_id__edit_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_update_voice_v1_voices__voice_id__edit_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Voice"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/lora/create":{"post":{"summary":"Create Lora","operationId":"create_lora_v1_lora_create_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLoraApiRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/lora/{lora_name}/status":{"get":{"summary":"Get Lora Status","operationId":"get_lora_status_v1_lora__lora_name__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lora_name","in":"path","required":true,"schema":{"type":"string","title":"Lora Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/lora/{lora_name}":{"get":{"summary":"Get Lora","operationId":"get_lora_v1_lora__lora_name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lora_name","in":"path","required":true,"schema":{"type":"string","title":"Lora Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Lora","operationId":"update_lora_v1_lora__lora_name__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lora_name","in":"path","required":true,"schema":{"type":"string","title":"Lora Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLoraApiRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Lora","operationId":"delete_lora_v1_lora__lora_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lora_name","in":"path","required":true,"schema":{"type":"string","title":"Lora Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/model/{model_name}/loras":{"get":{"summary":"Get Model Loras","operationId":"get_model_loras_v1_model__model_name__loras_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/user/loras":{"get":{"summary":"Get User Loras","operationId":"get_user_loras_v1_user_loras_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/containers/params":{"get":{"summary":"Container Rentals Get Params","operationId":"container_rentals_get_params_v1_containers_params_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/containers/gpu_availability":{"get":{"summary":"Rent Gpu Availability","operationId":"rent_gpu_availability_v1_containers_gpu_availability_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source","in":"query","required":false,"schema":{"type":"string","default":"","title":"Source"}},{"name":"base_model","in":"query","required":false,"schema":{"type":"string","default":"","title":"Base Model"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployGPUAvailability"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/containers":{"post":{"summary":"Container Rentals Start","operationId":"container_rentals_start_v1_containers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerRentalStartIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerRentalStartOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Too Many Requests"}}},"get":{"summary":"Container Rentals List","operationId":"container_rentals_list_v1_containers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"enum":["active","inactive"],"type":"string","description":"whether to return active or inactive containers","default":"active","title":"State"},"description":"whether to return active or inactive containers"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContainerRentalOut"},"title":"Response Container Rentals List V1 Containers Get"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"}}}},"/v1/containers/{container_id}":{"get":{"summary":"Container Rentals Get","operationId":"container_rentals_get_v1_containers__container_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"container_id","in":"path","required":true,"schema":{"type":"string","title":"Container Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerRentalOut"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Container Rentals Update","operationId":"container_rentals_update_v1_containers__container_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"container_id","in":"path","required":true,"schema":{"type":"string","title":"Container Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerRentalUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"}}},"delete":{"summary":"Container Rentals Delete","operationId":"container_rentals_delete_v1_containers__container_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"container_id","in":"path","required":true,"schema":{"type":"string","title":"Container Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/request-costs":{"post":{"summary":"Get Request Costs","operationId":"get_request_costs_v1_request_costs_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCostQuery"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCostResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/hardware":{"get":{"summary":"Get Hardware","operationId":"get_hardware_v2_hardware_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model","in":"query","required":true,"schema":{"type":"string","description":"Model name (NVIDIA NemoClaw format)","title":"Model"},"description":"Model name (NVIDIA NemoClaw format)"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HardwareResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/github/login":{"get":{"summary":"Github Login","description":"Initiate github SSO login flow. Callback is /github/callback","operationId":"github_login_github_login_get","parameters":[{"name":"login_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Login Id"}},{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},{"name":"deal","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal"}},{"name":"ti_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ti Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/okta/login":{"get":{"summary":"Okta Login","operationId":"okta_login_okta_login_get","parameters":[{"name":"team_id","in":"query","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},{"name":"login_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Login Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/github/cli/login":{"get":{"summary":"Github Cli Login","description":"deepctl is calling this request waiting for auth token during login.\nThe token is stored in /github/callback","operationId":"github_cli_login_github_cli_login_get","parameters":[{"name":"login_id","in":"query","required":true,"schema":{"type":"string","title":"Login Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-tokens":{"get":{"summary":"Get Api Tokens","operationId":"get_api_tokens_v1_api_tokens_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiToken"},"title":"Response Get Api Tokens V1 Api Tokens Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Api Token","operationId":"create_api_token_v1_api_tokens_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToken"}}}},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-tokens/{api_token}":{"get":{"summary":"Get Api Token","operationId":"get_api_token_v1_api_tokens__api_token__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"api_token","in":"path","required":true,"schema":{"type":"string","title":"Api Token"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToken"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Api Token","operationId":"delete_api_token_v1_api_tokens__api_token__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"api_token","in":"path","required":true,"schema":{"type":"string","title":"Api Token"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-tokens/{api_token}/vercel_export":{"post":{"summary":"Export Api Token To Vercel","operationId":"export_api_token_to_vercel_v1_api_tokens__api_token__vercel_export_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"api_token","in":"path","required":true,"schema":{"type":"string","title":"Api Token"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenVercelExportIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/scoped-jwt":{"post":{"summary":" Create Scoped Jwt","operationId":"_create_scoped_jwt_v1_scoped_jwt_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedJWTIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedJWTOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Inspect Scoped Jwt","operationId":"inspect_scoped_jwt_v1_scoped_jwt_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"jwtoken","in":"query","required":true,"schema":{"type":"string","title":"Jwtoken"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InspectScopedJWTOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ssh_keys":{"get":{"summary":"Get Ssh Keys","operationId":"get_ssh_keys_v1_ssh_keys_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SshKeyOut"},"title":"Response Get Ssh Keys V1 Ssh Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Ssh Key","operationId":"create_ssh_key_v1_ssh_keys_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SshKeyIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SshKeyOut"}}}},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ssh_keys/{ssh_key_id}":{"delete":{"summary":"Delete Ssh Key","operationId":"delete_ssh_key_v1_ssh_keys__ssh_key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ssh_key_id","in":"path","required":true,"schema":{"type":"string","title":"Ssh Key Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/checklist":{"get":{"summary":"Get Checklist","operationId":"get_checklist_payment_checklist_get","parameters":[{"name":"compute_owed","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Compute Owed"}},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checklist"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/payment/config":{"get":{"summary":"Get Config","operationId":"get_config_payment_config_get","parameters":[{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"summary":"Set Config","operationId":"set_config_payment_config_post","parameters":[{"name":"session","in":"cookie","schema":{"type":"String"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/payment/billing-portal":{"get":{"summary":"Billing Portal","operationId":"billing_portal_payment_billing_portal_get","parameters":[{"name":"return_url","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return Url"}},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPortalOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/payment/usage":{"get":{"summary":"Usage","operationId":"usage_payment_usage_get","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format","title":"From"},"description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"end of period (if missing a single month marked by from is return), same format as from","title":"To"},"description":"end of period (if missing a single month marked by from is return), same format as from"},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/payment/usage/tokens":{"get":{"summary":"Usage Tokens","operationId":"usage_tokens_payment_usage_tokens_get","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format","title":"From"},"description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"end of period (if missing a single month marked by from is return), same format as from","title":"To"},"description":"end of period (if missing a single month marked by from is return), same format as from"},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/payment/usage/rent":{"get":{"summary":"Usage Rent","operationId":"usage_rent_payment_usage_rent_get","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"integer","description":"start of period, in seconds since unix epoch","title":"From"},"description":"start of period, in seconds since unix epoch"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"end of period, in seconds since unix epoch","title":"To"},"description":"end of period, in seconds since unix epoch"},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageRentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/payment/usage/{api_token}":{"get":{"summary":"Usage Api Token","operationId":"usage_api_token_payment_usage__api_token__get","parameters":[{"name":"api_token","in":"path","required":true,"schema":{"type":"string","title":"Api Token"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format","title":"From"},"description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"end of period (if missing a single month marked by from is return), same format as from","title":"To"},"description":"end of period (if missing a single month marked by from is return), same format as from"},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/payment/deepstart/application":{"post":{"summary":"Deepstart Apply","operationId":"deepstart_apply_payment_deepstart_application_post","parameters":[{"name":"session","in":"cookie","schema":{"type":"String"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepStartApplicationIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepStartApplicationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/payment/funds":{"post":{"summary":"Add Funds","operationId":"add_funds_payment_funds_post","parameters":[{"name":"session","in":"cookie","schema":{"type":"String"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFundsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/payment/topup":{"post":{"summary":"Setup Topup","operationId":"setup_topup_payment_topup_post","parameters":[{"name":"session","in":"cookie","schema":{"type":"String"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}}},"components":{"schemas":{"AddFundsIn":{"properties":{"amount":{"type":"integer","title":"Amount","description":"Amount to add in cents"}},"type":"object","required":["amount"],"title":"AddFundsIn"},"BillingPortalOut":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"BillingPortalOut"},"Checklist":{"properties":{"email":{"type":"boolean","title":"Email","default":false},"billing_address":{"type":"boolean","title":"Billing Address","default":false},"payment_method":{"type":"boolean","title":"Payment Method","default":false},"suspended":{"type":"boolean","title":"Suspended","default":false},"overdue_invoices":{"type":"number","title":"Overdue Invoices","default":0.0},"last_checked":{"type":"integer","title":"Last Checked","default":0},"stripe_balance":{"type":"number","title":"Stripe Balance","description":"Negative value indicates funds ready-to-spend. Positive value indicates money owed"},"recent":{"type":"number","title":"Recent","description":"usage since most recent invoice"},"limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit"},"suspend_reason":{"anyOf":[{"$ref":"#/components/schemas/SuspendReason"},{"type":"null"}]},"topup":{"type":"boolean","title":"Topup","default":false},"topup_amount":{"type":"integer","title":"Topup Amount","default":0},"topup_threshold":{"type":"integer","title":"Topup Threshold","default":0},"topup_failed":{"type":"boolean","title":"Topup Failed","default":false}},"type":"object","required":["stripe_balance","recent","limit","suspend_reason"],"title":"Checklist"},"ConfigIn":{"properties":{"limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit","description":"Set usage limit (in USD). Negative means no limit.null/not-set means don't change it"}},"type":"object","title":"ConfigIn"},"ConfigOut":{"properties":{"limit":{"type":"number","title":"Limit","description":"Spending limit (in USD). Negative means no limit"}},"type":"object","required":["limit"],"title":"ConfigOut"},"DeepStartApplicationIn":{"properties":{"id":{"type":"string","title":"Id"},"uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uid"},"company":{"type":"string","title":"Company"},"ceo":{"type":"string","title":"Ceo"},"funding":{"type":"string","title":"Funding"},"founded_on":{"type":"string","title":"Founded On"},"website":{"type":"string","title":"Website"},"created_at":{"type":"integer","title":"Created At"},"status":{"type":"string","title":"Status","default":"pending"},"deal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal"}},"type":"object","required":["company","ceo","funding","founded_on","website"],"title":"DeepStartApplicationIn"},"DeepStartApplicationOut":{"properties":{"id":{"type":"string","title":"Id"},"uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uid"},"company":{"type":"string","title":"Company"},"ceo":{"type":"string","title":"Ceo"},"funding":{"type":"string","title":"Funding"},"founded_on":{"type":"string","title":"Founded On"},"website":{"type":"string","title":"Website"},"created_at":{"type":"integer","title":"Created At"},"status":{"type":"string","title":"Status","default":"pending"},"deal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["company","ceo","funding","founded_on","website"],"title":"DeepStartApplicationOut"},"DiscountMeta":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"description of the discount, only for display purposes"}},"type":"object","required":["name"],"title":"DiscountMeta"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ModelMeta":{"properties":{"provider":{"type":"string","title":"Provider"},"model_name":{"type":"string","title":"Model Name"},"task":{"type":"string","title":"Task"},"plan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Id"},"private":{"type":"boolean","title":"Private","default":false}},"type":"object","required":["provider","model_name","task"],"title":"ModelMeta"},"SuspendReason":{"type":"string","enum":["balance","payment-method","overdue-invoices","limit-reached","admin","bad-cc"],"title":"SuspendReason"},"TimeInterval":{"properties":{"fr":{"type":"integer","title":"Fr","default":0},"to":{"type":"integer","title":"To","default":4000000000000}},"type":"object","title":"TimeInterval","description":"Inclusive, in ms"},"TopUpIn":{"properties":{"amount":{"type":"integer","title":"Amount","description":"Amount to top up in cents","default":0},"threshold":{"type":"integer","title":"Threshold","description":"Top up threshold in cents, if balance goes below this value, top up will be triggered","default":0},"enabled":{"type":"boolean","title":"Enabled","description":"If true, top up will be triggered when balance goes below threshold","default":true}},"type":"object","title":"TopUpIn"},"UsageItem":{"properties":{"model":{"$ref":"#/components/schemas/ModelMeta"},"units":{"type":"integer","title":"Units","description":"billed seconds or tokens"},"rate":{"type":"number","title":"Rate","description":"rate in cents/sec or cents per token"},"cost":{"type":"integer","title":"Cost","description":"model cost in cents"},"pricing_type":{"type":"string","title":"Pricing Type","description":"pricing type"},"interval":{"$ref":"#/components/schemas/TimeInterval","description":"time interval with this particular pricing"},"discount":{"anyOf":[{"$ref":"#/components/schemas/DiscountMeta"},{"type":"null"}],"description":"discount meta, only if pricing_type is discount"}},"type":"object","required":["model","units","rate","cost","pricing_type","interval"],"title":"UsageItem"},"UsageMonth":{"properties":{"period":{"type":"string","title":"Period","description":"YYYY.MM formatted period"},"interval":{"$ref":"#/components/schemas/TimeInterval","description":"time interval in this period"},"items":{"items":{"$ref":"#/components/schemas/UsageItem"},"type":"array","title":"Items"},"total_cost":{"type":"integer","title":"Total Cost","description":"total cost for all items in cents"},"invoice_id":{"type":"string","title":"Invoice Id","description":"Stripe Invoice ID, or EMPTY|NOT_FINAL","default":"NOT_FINAL"}},"type":"object","required":["period","interval","items","total_cost"],"title":"UsageMonth"},"UsageOut":{"properties":{"months":{"items":{"$ref":"#/components/schemas/UsageMonth"},"type":"array","title":"Months"},"initial_month":{"type":"string","title":"Initial Month","description":"The first month for this account"}},"type":"object","required":["months","initial_month"],"title":"UsageOut"},"UsageRentOut":{"properties":{"id_to_duration":{"additionalProperties":{"type":"integer"},"type":"object","title":"Id To Duration","description":"container id to duration in seconds"}},"type":"object","required":["id_to_duration"],"title":"UsageRentOut"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"AnthropicMessagesIn":{"properties":{"model":{"type":"string","title":"Model"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"system":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/AnthropicSystemContent"},"type":"array"},{"type":"null"}],"title":"System"},"stop_sequences":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop Sequences"},"stream":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream","default":false},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":1.0},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"},"top_k":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Top K"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/AnthropicTool"},"type":"array"},{"type":"null"}],"title":"Tools"},"tool_choice":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Choice"},"thinking":{"anyOf":[{"$ref":"#/components/schemas/AnthropicThinkingConfig"},{"type":"null"}]}},"type":"object","required":["model","messages"],"title":"AnthropicMessagesIn"},"AnthropicSystemContent":{"properties":{"type":{"type":"string","const":"text","title":"Type"},"text":{"type":"string","title":"Text"}},"type":"object","required":["type","text"],"title":"AnthropicSystemContent"},"AnthropicThinkingConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","title":"AnthropicThinkingConfig"},"AnthropicTokenCountRequest":{"properties":{"model":{"type":"string","title":"Model"},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"system":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/AnthropicSystemContent"},"type":"array"},{"type":"null"}],"title":"System"},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/AnthropicTool"},"type":"array"},{"type":"null"}],"title":"Tools"},"thinking":{"anyOf":[{"$ref":"#/components/schemas/AnthropicThinkingConfig"},{"type":"null"}]},"tool_choice":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Choice"}},"type":"object","required":["model","messages"],"title":"AnthropicTokenCountRequest"},"AnthropicTool":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"}},"type":"object","required":["name","input_schema"],"title":"AnthropicTool"},"ApiToken":{"properties":{"token":{"type":"string","title":"Token"},"created_at":{"type":"integer","title":"Created At","description":"creation unix timestamp"},"name":{"type":"string","title":"Name"},"token_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Id"},"allowed_ips":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Ips"}},"type":"object","required":["token","created_at","name"],"title":"ApiToken"},"ApiTokenIn":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"ApiTokenIn"},"ApiTokenVercelExportIn":{"properties":{"project_id_or_name":{"type":"string","title":"Project Id Or Name"},"is_sensitive":{"type":"boolean","title":"Is Sensitive"},"env_development":{"type":"boolean","title":"Env Development"},"env_preview":{"type":"boolean","title":"Env Preview"},"env_production":{"type":"boolean","title":"Env Production"}},"type":"object","required":["project_id_or_name","is_sensitive","env_development","env_preview","env_production"],"title":"ApiTokenVercelExportIn"},"Body_create_voice_v1_voices_add_post":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["name","description","files"],"title":"Body_create_voice_v1_voices_add_post"},"Body_openai_audio_transcriptions_v1_audio_transcriptions_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"model":{"type":"string","title":"Model"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"response_format":{"anyOf":[{"type":"string","enum":["json","verbose_json","text","srt","vtt"]},{"type":"null"}],"title":"Response Format","default":"json"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":0},"timestamp_granularities":{"anyOf":[{"items":{"type":"string","enum":["segment","word"]},"type":"array"},{"type":"null"}],"title":"Timestamp Granularities"}},"type":"object","required":["file","model"],"title":"Body_openai_audio_transcriptions_v1_audio_transcriptions_post"},"Body_openai_audio_transcriptions_v1_openai_audio_transcriptions_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"model":{"type":"string","title":"Model"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"response_format":{"anyOf":[{"type":"string","enum":["json","verbose_json","text","srt","vtt"]},{"type":"null"}],"title":"Response Format","default":"json"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":0},"timestamp_granularities":{"anyOf":[{"items":{"type":"string","enum":["segment","word"]},"type":"array"},{"type":"null"}],"title":"Timestamp Granularities"}},"type":"object","required":["file","model"],"title":"Body_openai_audio_transcriptions_v1_openai_audio_transcriptions_post"},"Body_openai_audio_translations_v1_audio_translations_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"model":{"type":"string","title":"Model"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"response_format":{"anyOf":[{"type":"string","enum":["json","verbose_json","text","srt","vtt"]},{"type":"null"}],"title":"Response Format","default":"json"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":0}},"type":"object","required":["file","model"],"title":"Body_openai_audio_translations_v1_audio_translations_post"},"Body_openai_audio_translations_v1_openai_audio_translations_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"model":{"type":"string","title":"Model"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"response_format":{"anyOf":[{"type":"string","enum":["json","verbose_json","text","srt","vtt"]},{"type":"null"}],"title":"Response Format","default":"json"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":0}},"type":"object","required":["file","model"],"title":"Body_openai_audio_translations_v1_openai_audio_translations_post"},"Body_openai_files_v1_files_post":{"properties":{"purpose":{"type":"string","title":"Purpose"},"file":{"items":{"type":"string","format":"binary"},"type":"array","title":"File"}},"type":"object","required":["purpose","file"],"title":"Body_openai_files_v1_files_post"},"Body_openai_files_v1_openai_files_post":{"properties":{"purpose":{"type":"string","title":"Purpose"},"file":{"items":{"type":"string","format":"binary"},"type":"array","title":"File"}},"type":"object","required":["purpose","file"],"title":"Body_openai_files_v1_openai_files_post"},"Body_openai_images_edits_v1_images_edits_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"inp":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesEditsIn"},{"type":"null"}]},"prompt":{"type":"string","title":"Prompt"},"model":{"type":"string","title":"Model"}},"type":"object","required":["image","prompt","model"],"title":"Body_openai_images_edits_v1_images_edits_post"},"Body_openai_images_edits_v1_openai_images_edits_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"inp":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesEditsIn"},{"type":"null"}]},"prompt":{"type":"string","title":"Prompt"},"model":{"type":"string","title":"Model"}},"type":"object","required":["image","prompt","model"],"title":"Body_openai_images_edits_v1_openai_images_edits_post"},"Body_openai_images_variations_v1_images_variations_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"inp":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesVariationsIn"},{"type":"null"}]},"model":{"type":"string","title":"Model"}},"type":"object","required":["image","model"],"title":"Body_openai_images_variations_v1_images_variations_post"},"Body_openai_images_variations_v1_openai_images_variations_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"inp":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesVariationsIn"},{"type":"null"}]},"model":{"type":"string","title":"Model"}},"type":"object","required":["image","model"],"title":"Body_openai_images_variations_v1_openai_images_variations_post"},"Body_update_voice_v1_voices__voice_id__edit_post":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","description"],"title":"Body_update_voice_v1_voices__voice_id__edit_post"},"ChatCompletionAssistantMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"assistant","title":"Role","description":"the role of the author of this message","default":"assistant"},"content":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/ChatCompletionContentPartText"},"type":"array"},{"type":"null"}],"title":"Content","description":"the message content"},"reasoning_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Content","description":"the reasoning content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"tool_calls":{"anyOf":[{"items":{"$ref":"#/components/schemas/ChatCompletionMessageToolCall"},"type":"array"},{"type":"null"}],"title":"Tool Calls","description":"the tool calls generated by the mode"}},"type":"object","title":"ChatCompletionAssistantMessage"},"ChatCompletionContentPartAudio":{"properties":{"type":{"type":"string","const":"input_audio","title":"Type"},"input_audio":{"$ref":"#/components/schemas/InputAudio"}},"type":"object","required":["type","input_audio"],"title":"ChatCompletionContentPartAudio"},"ChatCompletionContentPartImage":{"properties":{"type":{"type":"string","const":"image_url","title":"Type"},"image_url":{"$ref":"#/components/schemas/ImageURL"}},"type":"object","required":["type","image_url"],"title":"ChatCompletionContentPartImage"},"ChatCompletionContentPartText":{"properties":{"type":{"type":"string","const":"text","title":"Type"},"text":{"type":"string","title":"Text"}},"type":"object","required":["type","text"],"title":"ChatCompletionContentPartText"},"ChatCompletionMessageToolCall":{"properties":{"id":{"type":"string","title":"Id","description":"the id of the tool call"},"type":{"type":"string","title":"Type","description":"the type of the tool call. only function is supported currently"},"function":{"$ref":"#/components/schemas/Function","description":"the function that the model called"}},"type":"object","required":["id","type","function"],"title":"ChatCompletionMessageToolCall"},"ChatCompletionSystemMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"system","title":"Role","description":"the role of the author of this message","default":"system"},"content":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/ChatCompletionContentPartText"},"type":"array"}],"title":"Content","description":"the message content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["content"],"title":"ChatCompletionSystemMessage"},"ChatCompletionToolMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"tool","title":"Role","description":"the role of the author of this message","default":"tool"},"content":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/ChatCompletionContentPartText"},"type":"array"}],"title":"Content","description":"the message content"},"tool_call_id":{"type":"string","title":"Tool Call Id"}},"type":"object","required":["content","tool_call_id"],"title":"ChatCompletionToolMessage"},"ChatCompletionUserMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"user","title":"Role","description":"the role of the author of this message","default":"user"},"content":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletionContentPartText"},{"$ref":"#/components/schemas/ChatCompletionContentPartImage"},{"$ref":"#/components/schemas/ChatCompletionContentPartAudio"}]},"type":"array"}],"title":"Content","description":"the message content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["content"],"title":"ChatCompletionUserMessage"},"ChatReasoningSettings":{"properties":{"effort":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}],"title":"Effort","description":"Constrains effort on reasoning for reasoning models."},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Enable or disable reasoning with default parameters."}},"type":"object","title":"ChatReasoningSettings"},"ChatTools":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"type":{"type":"string","title":"Type","default":"function"},"function":{"$ref":"#/components/schemas/FunctionDefinition"}},"type":"object","required":["function"],"title":"ChatTools"},"CompletionMultiModalData":{"properties":{"image":{"items":{"type":"string"},"type":"array","title":"Image","description":"List of images as base64 data URIs (e.g. 'data:image/png;base64,...'). Each image must correspond to a placeholder token in the prompt."}},"type":"object","title":"CompletionMultiModalData"},"ContainerRentalOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"state":{"$ref":"#/components/schemas/ContainerRentalStateOut"},"start_ts":{"type":"integer","title":"Start Ts"},"state_ts":{"type":"integer","title":"State Ts"},"stop_ts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stop Ts"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip"},"gpu_config":{"type":"string","title":"Gpu Config"},"price_per_hour":{"type":"number","title":"Price Per Hour"},"container_image":{"type":"string","title":"Container Image"},"fail_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fail Reason"}},"type":"object","required":["id","name","state","start_ts","state_ts","stop_ts","ip","gpu_config","price_per_hour","container_image","fail_reason"],"title":"ContainerRentalOut"},"ContainerRentalStartIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Container Name"},"gpu_config":{"type":"string","minLength":1,"title":"Gpu Config","description":"GPU config"},"container_image":{"type":"string","minLength":1,"title":"Container Image","description":"Container Image"},"cloud_init_user_data":{"type":"string","maxLength":32000,"minLength":1,"title":"Cloud Init User Data","description":"Cloud Init User Data"}},"type":"object","required":["name","gpu_config","container_image","cloud_init_user_data"],"title":"ContainerRentalStartIn"},"ContainerRentalStartOut":{"properties":{"container_id":{"type":"string","title":"Container Id","description":"Container Id"}},"type":"object","required":["container_id"],"title":"ContainerRentalStartOut"},"ContainerRentalStateOut":{"type":"string","enum":["creating","starting","running","shutting_down","failed","deleted"],"title":"ContainerRentalStateOut"},"ContainerRentalUpdateIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Container Name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"ContainerRentalUpdateIn"},"CreateLoraApiRequest":{"properties":{"base_model":{"type":"string","title":"Base Model"},"lora_name":{"type":"string","title":"Lora Name"},"source":{"$ref":"#/components/schemas/SourceModel"},"private":{"type":"boolean","title":"Private"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""}},"type":"object","required":["base_model","lora_name","source","private"],"title":"CreateLoraApiRequest"},"DeepError":{"properties":{"error":{"type":"string","title":"Error","description":"Error","examples":["Model not found"]}},"type":"object","required":["error"],"title":"DeepError"},"DeployDelete":{"properties":{"deploy_id":{"type":"string","title":"Deploy Id","description":"Deploy Id","examples":["fkj843kjh8"]}},"type":"object","required":["deploy_id"],"title":"DeployDelete"},"DeployGPUAvailability":{"properties":{"gpus":{"items":{"$ref":"#/components/schemas/GPUAvailabilityInfo"},"type":"array","title":"Gpus","description":"A list of all provided GPUs configurations, including their price and wether they are available"}},"type":"object","required":["gpus"],"title":"DeployGPUAvailability"},"DeployGPUs":{"type":"string","enum":["L4-24GB","L40S-48GB","A100-80GB","H100-80GB","H200-141GB","B200-180GB","B300-270GB","RTXPRO6000-96GB","other"],"title":"DeployGPUs"},"DeployInstances":{"properties":{"running":{"type":"integer","title":"Running"},"pending":{"type":"integer","title":"Pending"}},"type":"object","required":["running","pending"],"title":"DeployInstances"},"DeployLLMConfig":{"properties":{"gpu":{"$ref":"#/components/schemas/DeployGPUs","description":"The type of GPU the deployment is running on"},"num_gpus":{"type":"integer","title":"Num Gpus","description":"Number of GPUs used by one instance"},"max_batch_size":{"type":"integer","title":"Max Batch Size","description":"Maximum number of concurrent requests"},"weights":{"anyOf":[{"$ref":"#/components/schemas/HFWeights"},{"type":"null"}],"description":"Model weights information"}},"type":"object","required":["gpu","num_gpus","max_batch_size"],"title":"DeployLLMConfig"},"DeployLLMIn":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"model name for deepinfra (username/mode-name format)"},"gpu":{"$ref":"#/components/schemas/DeployGPUs","description":"The type of GPU the deployment is running on"},"num_gpus":{"type":"integer","maximum":8.0,"minimum":1.0,"title":"Num Gpus","description":"Number of GPUs used by one instance","default":1},"max_batch_size":{"type":"integer","maximum":256.0,"minimum":1.0,"title":"Max Batch Size","description":"Maximum number of concurrent requests","default":96},"hf":{"anyOf":[{"$ref":"#/components/schemas/HFWeights"},{"type":"null"}]},"base_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model","description":"Base public model"},"container_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Container Image","description":"Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4)"},"settings":{"anyOf":[{"$ref":"#/components/schemas/ScaleSettings"},{"type":"null"}]},"extra_args":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Args","description":"Extra command line arguments for custom deployments"}},"type":"object","required":["model_name","gpu"],"title":"DeployLLMIn"},"DeployLLMUpdateIn":{"properties":{"settings":{"$ref":"#/components/schemas/ScaleSettings"}},"type":"object","required":["settings"],"title":"DeployLLMUpdateIn"},"DeployModelIn":{"properties":{"provider":{"$ref":"#/components/schemas/ModelProvider","description":"namespace for the model name","default":"cnt"},"model_name":{"type":"string","title":"Model Name","description":"model name in specified provider"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"A specific revision, if left empty uses the last one"}},"type":"object","required":["model_name"],"title":"DeployModelIn"},"DeployResult":{"properties":{"deploy_id":{"type":"string","title":"Deploy Id","description":"Deploy Id","examples":["fkj843kjh8"]}},"type":"object","required":["deploy_id"],"title":"DeployResult"},"DeployStatusOut":{"properties":{"deploy_id":{"type":"string","title":"Deploy Id","description":"Deploy Id","examples":["fkj843kjh8"]}},"type":"object","required":["deploy_id"],"title":"DeployStatusOut"},"DeployType":{"type":"string","enum":["legacy","llm","lora","tts"],"title":"DeployType"},"DeploymentLogEntry":{"prefixItems":[{"type":"string","title":"Ts","description":"timestamp in fractional seconds since unix epoch (ns precision)"},{"type":"string","title":"Line","description":"a single log line"}],"type":"array","maxItems":2,"minItems":2},"DeploymentLogQueryOut":{"properties":{"entries":{"additionalProperties":{"items":{"$ref":"#/components/schemas/DeploymentLogEntry"},"type":"array"},"type":"object","title":"Entries","description":"mapping of pod names to log lines ordered by increasing timestamp"}},"type":"object","title":"DeploymentLogQueryOut"},"DeploymentMainStatsOut":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Model name","examples":["google/vit-base-patch16-224"]},"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"}},"type":"object","required":["model_name","requests"],"title":"DeploymentMainStatsOut"},"DeploymentOut":{"properties":{"type":{"$ref":"#/components/schemas/DeployType","default":"legacy"},"deploy_id":{"type":"string","title":"Deploy Id","description":"Deploy Id","examples":["fkj843kjh8"]},"model_name":{"type":"string","title":"Model Name","description":"Model Id from huggingface","examples":["google/vit-base-patch16-224"]},"version":{"type":"string","title":"Version","description":"Model version","examples":["d8b79b422843bd59d628bf25b01aded94a9ec1a9b917e69fe460df9ff39ec42b"]},"task":{"type":"string","title":"Task","description":"Task","examples":["image-classification"]},"status":{"type":"string","title":"Status","description":"Status","examples":["deployed"]},"fail_reason":{"type":"string","title":"Fail Reason","description":"Failure reason","examples":["Initialization failed"]},"created_at":{"type":"string","title":"Created At","description":"Created at","examples":["2021-08-27T17:19:21+00:00"]},"updated_at":{"type":"string","title":"Updated At","description":"Updated at","examples":["2021-08-27T17:19:21+00:00"]},"instances":{"anyOf":[{"$ref":"#/components/schemas/DeployInstances"},{"type":"null"}],"description":"Details about number of instances running right now"},"config":{"anyOf":[{"$ref":"#/components/schemas/DeployLLMConfig"},{"type":"null"}],"description":"Immutable deploy configuration"},"settings":{"anyOf":[{"$ref":"#/components/schemas/ScaleSettings"},{"type":"null"}],"description":"Scale Settings"}},"type":"object","required":["deploy_id","model_name","version","task","status","fail_reason","created_at","updated_at"],"title":"DeploymentOut"},"DeploymentStatsOut":{"properties":{"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"},"total_time":{"type":"integer","title":"Total Time","description":"total number of seconds spend in inference"},"total_tokens":{"type":"integer","title":"Total Tokens","description":"total number of tokens generated"},"input_tokens":{"type":"integer","title":"Input Tokens","description":"number of input tokens generated"},"output_tokens":{"type":"integer","title":"Output Tokens","description":"number of output tokens generated"},"total_amount":{"type":"integer","title":"Total Amount","description":"total number of cents spent"},"avg_time":{"type":"number","title":"Avg Time","description":"average millisecond inference time"},"avg95_time":{"type":"number","title":"Avg95 Time","description":"95th percentile inference time (estimated)"},"errors":{"type":"integer","title":"Errors","description":"number of errors"}},"type":"object","required":["requests","total_time","total_tokens","input_tokens","output_tokens","total_amount","avg_time","avg95_time","errors"],"title":"DeploymentStatsOut"},"DetailedDeploymentStatsOut":{"properties":{"llm":{"anyOf":[{"$ref":"#/components/schemas/LLMDeploymentStatsOut"},{"type":"null"}],"description":"LLM Deployment Stats"},"embeddings":{"anyOf":[{"$ref":"#/components/schemas/EmbeddingsDeploymentStatsOut"},{"type":"null"}],"description":"Embeddings Deployment Stats"},"time":{"anyOf":[{"$ref":"#/components/schemas/TimeDeploymentStatsOut"},{"type":"null"}],"description":"Time based Deployment Stats"}},"type":"object","title":"DetailedDeploymentStatsOut"},"DisplayNameIn":{"properties":{"display_name":{"type":"string","maxLength":39,"minLength":1,"pattern":"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$","title":"Display Name","description":"String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes."}},"type":"object","required":["display_name"],"title":"DisplayNameIn"},"ElevenLabsTextToSpeechIn":{"properties":{"text":{"type":"string","title":"Text","description":"Text to convert to speech","examples":["I'm beginnin' to feel like a Rap God, Rap God\nAll my people from the front to the back nod, back nod\nNow, who thinks their arms are long enough to slap box, slap box?\nThey said I rap like a robot, so call me Rap-bot"]},"model_id":{"type":"string","title":"Model Id","description":"Model ID to use for the conversion","default":"hexgrad/Kokoro-82M"},"output_format":{"$ref":"#/components/schemas/TtsResponseFormat","description":"Output format for the speech"},"language_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Code","description":"ISO 639-1, 2 letter language code"}},"type":"object","required":["text"],"title":"ElevenLabsTextToSpeechIn"},"EmailsOut":{"properties":{"emails":{"items":{"type":"string"},"type":"array","title":"Emails","description":"List of emails verified by theauthenticaiton provider"}},"type":"object","required":["emails"],"title":"EmailsOut"},"EmbeddingsDeploymentStatsOut":{"properties":{"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"},"input_tokens":{"type":"integer","title":"Input Tokens","description":"number of input tokens generated"},"avg_tpt_ms":{"type":"number","title":"Avg Tpt Ms","description":"average millisecond time per token"},"avg95_tpt_ms":{"type":"number","title":"Avg95 Tpt Ms","description":"95th percentile time per token (estimated)"},"total_amount_cents":{"type":"integer","title":"Total Amount Cents","description":"total number of cents spent"},"errors":{"type":"integer","title":"Errors","description":"number of errors"}},"type":"object","required":["requests","input_tokens","avg_tpt_ms","avg95_tpt_ms","total_amount_cents","errors"],"title":"EmbeddingsDeploymentStatsOut"},"FAQEntryOut":{"properties":{"faq_id":{"type":"string","title":"Faq Id","description":"FAQ entry ID, usually the question"},"question":{"type":"string","title":"Question","description":"FAQ question"},"answer":{"type":"string","title":"Answer","description":"FAQ answer in markdown format"},"order":{"type":"integer","title":"Order","description":"order of the FAQ entry in the list, lower numbers come first","default":0}},"type":"object","required":["faq_id","question","answer"],"title":"FAQEntryOut"},"FeedbackIn":{"properties":{"message":{"type":"string","title":"Message","description":"The message you'd like to send to deepinfra team"},"contact_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Contact Email","description":"Optional contact email to reach you back"}},"type":"object","required":["message"],"title":"FeedbackIn"},"Function":{"properties":{"name":{"type":"string","title":"Name","description":"the name of the function to call"},"arguments":{"type":"string","title":"Arguments","description":"the function arguments, generated by the model in JSON format. the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema"}},"type":"object","required":["name","arguments"],"title":"Function"},"FunctionDefinition":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parameters"}},"type":"object","required":["name"],"title":"FunctionDefinition"},"GPUAvailabilityInfo":{"properties":{"gpu_config":{"type":"string","title":"Gpu Config"},"usd_per_hour":{"type":"number","title":"Usd Per Hour"},"available":{"type":"boolean","title":"Available"},"recommended":{"type":"boolean","title":"Recommended","default":false}},"type":"object","required":["gpu_config","usd_per_hour","available"],"title":"GPUAvailabilityInfo"},"GetVoicesOut":{"properties":{"voices":{"items":{"$ref":"#/components/schemas/Voice"},"type":"array","title":"Voices"}},"type":"object","title":"GetVoicesOut"},"GpuLimitOut":{"properties":{"limits":{"additionalProperties":{"type":"integer"},"type":"object","title":"Limits","description":"Effective GPU limits per type (defaults merged with overrides)"},"pending_requests":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Pending Requests","description":"Pending GPU limit increase requests per type"}},"type":"object","required":["limits"],"title":"GpuLimitOut"},"GpuLimitRequestIn":{"properties":{"gpu_type":{"type":"string","title":"Gpu Type"},"requested_limit":{"type":"integer","title":"Requested Limit"},"reason":{"type":"string","maxLength":2048,"title":"Reason"}},"type":"object","required":["gpu_type","requested_limit","reason"],"title":"GpuLimitRequestIn"},"HFModel":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Model Id from huggingface","examples":["google/vit-base-patch16-224"]},"task":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task","description":"Task","examples":["image-classification"]}},"type":"object","required":["model_name"],"title":"HFModel"},"HFTasksE":{"type":"string","enum":["automatic-speech-recognition","image-classification","question-answering","token-classification","text-to-image","fill-mask","zero-shot-image-classification","text2text-generation","text-generation","text-classification","object-detection","embeddings","dreambooth","custom","text-to-speech","text-to-video","rent-container","reranker"],"title":"HFTasksE"},"HFWeights":{"properties":{"repo":{"type":"string","title":"Repo","description":"huggingface repository i.e username/reponame"},"revision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision","description":"commit sha or branch name"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token","description":"huggingface access token with read access to the repo"}},"type":"object","required":["repo"],"title":"HFWeights"},"HardwareOption":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["serverless","dedicated"],"title":"Type"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/HardwarePricingServerless"},{"$ref":"#/components/schemas/HardwarePricingDedicated"}],"title":"Pricing"}},"type":"object","required":["id","name","type","pricing"],"title":"HardwareOption"},"HardwarePricingDedicated":{"properties":{"cents_per_minute":{"type":"number","title":"Cents Per Minute"}},"type":"object","required":["cents_per_minute"],"title":"HardwarePricingDedicated"},"HardwarePricingServerless":{"properties":{"cents_per_million_input_tokens":{"type":"number","title":"Cents Per Million Input Tokens"},"cents_per_million_output_tokens":{"type":"number","title":"Cents Per Million Output Tokens"}},"type":"object","required":["cents_per_million_input_tokens","cents_per_million_output_tokens"],"title":"HardwarePricingServerless"},"HardwareResponse":{"properties":{"hardware":{"items":{"$ref":"#/components/schemas/HardwareOption"},"type":"array","title":"Hardware"}},"type":"object","title":"HardwareResponse"},"ImageURL":{"properties":{"url":{"type":"string","title":"Url"},"detail":{"type":"string","enum":["auto","low","high"],"title":"Detail","default":"auto"}},"type":"object","required":["url"],"title":"ImageURL"},"InputAudio":{"properties":{"data":{"type":"string","title":"Data"},"format":{"type":"string","enum":["wav","mp3"],"title":"Format","default":"wav"}},"type":"object","required":["data"],"title":"InputAudio"},"InspectScopedJWTOut":{"properties":{"expires_at":{"type":"integer","title":"Expires At","description":"unix timestamp of when the token expires"},"models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Models","description":"which models is the token limited to"},"spending_limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spending Limit","description":"how much is the total spending limit set at creation"}},"type":"object","required":["expires_at"],"title":"InspectScopedJWTOut"},"JsonObjectResponseFormat":{"properties":{"type":{"type":"string","const":"json_object","title":"Type","default":"json_object"}},"type":"object","title":"JsonObjectResponseFormat"},"JsonSchema":{"properties":{"name":{"type":"string","title":"Name","description":"Name identifier for the JSON schema"},"schema":{"additionalProperties":true,"type":"object","title":"Schema","description":"The actual JSON schema definition"}},"type":"object","required":["name","schema"],"title":"JsonSchema"},"JsonSchemaResponseFormat":{"properties":{"type":{"type":"string","const":"json_schema","title":"Type","default":"json_schema"},"json_schema":{"$ref":"#/components/schemas/JsonSchema","description":"JSON schema for structured output when type is 'json_schema'"}},"type":"object","required":["json_schema"],"title":"JsonSchemaResponseFormat"},"LLMDeploymentStatsOut":{"properties":{"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"},"input_tokens":{"type":"integer","title":"Input Tokens","description":"number of input tokens generated"},"output_tokens":{"type":"integer","title":"Output Tokens","description":"number of output tokens generated"},"avg_ttft_ms":{"type":"number","title":"Avg Ttft Ms","description":"average millisecond time to first token"},"avg95_ttft_ms":{"type":"number","title":"Avg95 Ttft Ms","description":"95th percentile time to first token (estimated)"},"avg_tpt_ms":{"type":"number","title":"Avg Tpt Ms","description":"average millisecond time per token"},"avg95_tpt_ms":{"type":"number","title":"Avg95 Tpt Ms","description":"95th percentile time per token (estimated)"},"total_amount_cents":{"type":"integer","title":"Total Amount Cents","description":"total number of cents spent"},"errors":{"type":"integer","title":"Errors","description":"number of errors"}},"type":"object","required":["requests","input_tokens","output_tokens","avg_ttft_ms","avg95_ttft_ms","avg_tpt_ms","avg95_tpt_ms","total_amount_cents","errors"],"title":"LLMDeploymentStatsOut"},"LogEntry":{"prefixItems":[{"type":"string","title":"Ts","description":"timestamp in fractional seconds since unix epoch (ns precision)"},{"type":"string","title":"Line","description":"a single log line"}],"type":"array","maxItems":2,"minItems":2},"LogQueryOut":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/LogEntry"},"type":"array","title":"Entries","description":"list of log lines ordered by increasing timestamp"}},"type":"object","title":"LogQueryOut"},"LoraModelUploadIn":{"properties":{"hf_model_name":{"type":"string","title":"Hf Model Name"},"hf_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hf Token"},"lora_model_name":{"type":"string","title":"Lora Model Name"},"base_model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model Name"}},"type":"object","required":["hf_model_name","lora_model_name"],"title":"LoraModelUploadIn"},"Me":{"properties":{"uid":{"type":"string","title":"Uid"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"email_verified":{"type":"boolean","title":"Email Verified"},"account_setup":{"type":"boolean","title":"Account Setup"},"require_email_verified":{"type":"boolean","title":"Require Email Verified","default":false},"display_name":{"type":"string","title":"Display Name","description":"Name that is used to identifythe account on the website"},"provider":{"type":"string","title":"Provider","description":"Authentication provider, e.g. 'github'"},"picture":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Picture"},"is_admin":{"type":"boolean","title":"Is Admin"},"name":{"type":"string","title":"Name","description":"Personal name"},"first_name":{"type":"string","title":"First Name","description":"First name of the user"},"last_name":{"type":"string","title":"Last Name","description":"Last name of the user"},"country":{"type":"string","title":"Country","description":"Country of the user"},"is_business_account":{"type":"boolean","title":"Is Business Account"},"company":{"type":"string","title":"Company","description":"Company name"},"website":{"type":"string","title":"Website","description":"Company website address"},"title":{"type":"string","title":"Title","description":"Job title of the user, e.g. 'Software Engineer'"},"is_team_account":{"type":"boolean","title":"Is Team Account","default":false},"is_team_owner":{"type":"boolean","title":"Is Team Owner","default":false},"team_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Role"},"team_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Display Name"},"is_team_upgrade_enabled":{"type":"boolean","title":"Is Team Upgrade Enabled","default":true},"vercel_connection":{"anyOf":[{"$ref":"#/components/schemas/MeVercelConnection"},{"type":"null"}]},"checklist":{"anyOf":[{"$ref":"#/components/schemas/Checklist"},{"type":"null"}]}},"type":"object","required":["uid","email","email_verified","account_setup","display_name","provider","picture","is_admin","name","first_name","last_name","country","is_business_account","company","website","title"],"title":"Me"},"MeIn":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":256,"minLength":1},{"type":"null"}],"title":"Name","description":"Personal name"},"first_name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"First Name","description":"First name of the user"},"last_name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Last Name","description":"Last name of the user"},"country":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Country","description":"Country of the user"},"email":{"anyOf":[{"type":"string","maxLength":320,"minLength":1},{"type":"null"}],"title":"Email"},"is_business_account":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Business Account"},"company":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Company","description":"Company name"},"website":{"anyOf":[{"type":"string","maxLength":128,"minLength":0},{"type":"null"}],"title":"Website","description":"Company website address"},"title":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Title","description":"Job title of the user, e.g. 'Software Engineer'"},"display_name":{"anyOf":[{"type":"string","maxLength":39,"minLength":1,"pattern":"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"},{"type":"null"}],"title":"Display Name","description":"String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes."},"use_case":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Use Case","description":"Short description of the use case for the account"},"attribution":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Attribution","description":"Short description of how the user found out about DeepInfra"}},"type":"object","title":"MeIn"},"MeVercelConnection":{"properties":{"user_id":{"type":"string","title":"User Id"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"installation_id":{"type":"string","title":"Installation Id"}},"type":"object","required":["user_id","installation_id"],"title":"MeVercelConnection"},"ModelDocBlock":{"properties":{"key":{"$ref":"#/components/schemas/ModelDocBlockKey"},"url":{"type":"string","title":"Url"}},"type":"object","required":["key","url"],"title":"ModelDocBlock"},"ModelDocBlockKey":{"type":"string","enum":["http","http-bge-m3-multimodal","http-bagel-multimodal","deepctl","js-text-gen","js-emb","js-text-to-img","js-speech-to-text","openai-python","openai-python-short","openai-http","openai-js","openai-js-short","openai-speech-http","openai-speech-python","openai-speech-js","openai-images-http","openai-images-python","openai-images-js","openai-images-variations-http","openai-images-variations-python","openai-images-variations-js","openai-images-edits-http","openai-images-edits-python","openai-images-edits-js","openai-comp-python","openai-comp-python-short","openai-comp-http","openai-comp-js","openai-comp-js-short","openai-emb-py","openai-emb-http","openai-emb-js","openai-tts-http","openai-tts-python","openai-tts-js","elevenlabs-tts-http","elevenlabs-tts-python","elevenlabs-tts-js","create-voice-http","create-voice-python","create-voice-js","read-voice-http","read-voice-python","read-voice-js","update-voice-http","update-voice-python","update-voice-js","delete-voice-http","delete-voice-python","delete-voice-js","list-voices-http","list-voices-python","list-voices-js","ai-sdk-js","ai-sdk-js-short"],"title":"ModelDocBlockKey"},"ModelFamilyOut":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Model family name"},"title":{"type":"string","title":"Title","description":"Model family title"},"description":{"type":"string","title":"Description","description":"Model family description"},"developer":{"type":"string","title":"Developer","description":"Model family developer organization"},"meta_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Title","description":"Meta title for SEO"},"meta_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Description","description":"Meta description for SEO"},"featured_models":{"items":{"type":"string"},"type":"array","title":"Featured Models"},"pp_sections_out":{"items":{"$ref":"#/components/schemas/PricingPageSectionOut"},"type":"array","title":"Pp Sections Out"},"faq_entries":{"items":{"$ref":"#/components/schemas/FAQEntryOut"},"type":"array","title":"Faq Entries","description":"List of FAQ entries for this model family, ordered by their order field"}},"type":"object","required":["name","title","description","developer","featured_models","pp_sections_out"],"title":"ModelFamilyOut"},"ModelFieldInfo":{"properties":{"name":{"type":"string","title":"Name"},"parent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent"},"ftype":{"type":"string","title":"Ftype"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"allowed":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Allowed"},"default":{"title":"Default"},"examples":{"items":{},"type":"array","title":"Examples","default":[]},"minimum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Minimum"},"exclusiveMinimum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exclusiveminimum"},"maximum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Maximum"},"exclusiveMaximum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exclusivemaximum"}},"type":"object","required":["name","ftype"],"title":"ModelFieldInfo"},"ModelInfoOut":{"properties":{"model_name":{"type":"string","title":"Model Name"},"type":{"type":"string","title":"Type"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"reported_type":{"type":"string","title":"Reported Type"},"version":{"type":"string","title":"Version"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"mf_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mf Description"},"featured":{"type":"boolean","title":"Featured"},"owner":{"type":"boolean","title":"Owner","default":false},"public":{"type":"boolean","title":"Public"},"curl_inv":{"type":"string","title":"Curl Inv"},"cmdline_inv":{"type":"string","title":"Cmdline Inv"},"txt_docs":{"type":"string","title":"Txt Docs"},"out_example":{"type":"string","title":"Out Example"},"out_docs":{"type":"string","title":"Out Docs"},"mask_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mask Token"},"in_schema":{"title":"In Schema"},"out_schema":{"title":"Out Schema"},"in_fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/ModelFieldInfo"},"type":"array"},{"type":"null"}],"title":"In Fields"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/ModelPricingTime"},{"$ref":"#/components/schemas/ModelPricingUptime"},{"$ref":"#/components/schemas/ModelPricingTokens"},{"$ref":"#/components/schemas/ModelPricingInputLength"},{"$ref":"#/components/schemas/ModelPricingInputTokens"},{"$ref":"#/components/schemas/ModelPricingInputCharacterLength"},{"$ref":"#/components/schemas/ModelPricingImageUnits"},{"$ref":"#/components/schemas/ModelPricingOutputLength"}],"title":"Pricing"},"doc_blocks":{"anyOf":[{"items":{"$ref":"#/components/schemas/ModelDocBlock"},"type":"array"},{"type":"null"}],"title":"Doc Blocks"},"short_doc_block":{"anyOf":[{"$ref":"#/components/schemas/ModelDocBlock"},{"type":"null"}]},"schemas":{"items":{"$ref":"#/components/schemas/SchemaVariant"},"type":"array","title":"Schemas"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","default":{}},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"max_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Output Tokens"},"replaced_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replaced By"},"deprecated":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deprecated"},"quantization":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantization"},"mmlu":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mmlu"},"expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected"},"import_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Import Time"},"is_partner":{"type":"boolean","title":"Is Partner","default":false},"is_custom_deployable":{"type":"boolean","title":"Is Custom Deployable","default":false},"mf_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mf Name"},"mf_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mf Title"}},"type":"object","required":["model_name","type","tags","reported_type","version","featured","public","curl_inv","cmdline_inv","txt_docs","out_example","out_docs","pricing","schemas"],"title":"ModelInfoOut"},"ModelMetaIn":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"short model description in plain text"},"github_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Github Url","description":"source code project link (empty to delete)"},"paper_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paper Url","description":"paper/research link (empty to delete)"},"license_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Url","description":"usage license link (empty to delete)"},"readme":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Readme","description":"markdown flavored model readme"},"cover_img_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cover Img Url","description":"dataurl or regular url to cover image (empty to delete)"},"reported_type":{"anyOf":[{"$ref":"#/components/schemas/HFTasksE"},{"type":"null"}],"description":"model type"}},"additionalProperties":false,"type":"object","title":"ModelMetaIn"},"ModelMetadata":{"properties":{"description":{"type":"string","title":"Description"},"context_length":{"type":"integer","title":"Context Length"},"max_tokens":{"type":"integer","title":"Max Tokens"},"pricing":{"additionalProperties":{"type":"number"},"type":"object","title":"Pricing"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","required":["description","context_length","max_tokens","pricing","tags"],"title":"ModelMetadata"},"ModelOut":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Model Name","examples":["microsoft/resnet-50"]},"type":{"type":"string","title":"Type","description":"raw type of the model","examples":["image-classification"]},"reported_type":{"type":"string","title":"Reported Type","description":"reported type of the model","examples":["text-generation"]},"description":{"type":"string","title":"Description","description":"description of the model","default":"","examples":["ResNet-50 is a convolutional neural network that is trained on more than a million images from the ImageNet database. It is a 50-layer deep neural network."]},"cover_img_url":{"type":"string","title":"Cover Img Url","description":"cover image link","default":""},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"list of tags"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/ModelPricingTime"},{"$ref":"#/components/schemas/ModelPricingTokens"},{"$ref":"#/components/schemas/ModelPricingInputLength"},{"$ref":"#/components/schemas/ModelPricingInputTokens"},{"$ref":"#/components/schemas/ModelPricingUptime"},{"$ref":"#/components/schemas/ModelPricingInputCharacterLength"},{"$ref":"#/components/schemas/ModelPricingImageUnits"},{"$ref":"#/components/schemas/ModelPricingOutputLength"}],"title":"Pricing","description":"The pricing type and cost for this model"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens","description":"The maximum context size of this model, if applicable"},"replaced_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replaced By"},"deprecated":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deprecated"},"quantization":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantization"},"mmlu":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mmlu"},"expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected"},"private":{"type":"integer","title":"Private","default":0},"is_partner":{"type":"boolean","title":"Is Partner","default":false}},"type":"object","required":["model_name","type","reported_type","pricing"],"title":"ModelOut"},"ModelPricingImageUnits":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"image_units"},"cents_per_image_unit":{"type":"number","title":"Cents Per Image Unit"},"default_width":{"type":"integer","title":"Default Width"},"default_height":{"type":"integer","title":"Default Height"},"default_iterations":{"type":"integer","title":"Default Iterations"},"default_price_cents":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Default Price Cents"},"usage_from_cost":{"type":"boolean","title":"Usage From Cost"}},"type":"object","required":["cents_per_image_unit","default_width","default_height","default_iterations","usage_from_cost"],"title":"ModelPricingImageUnits"},"ModelPricingInputCharacterLength":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"input_character_length"},"cents_per_input_chars":{"type":"number","title":"Cents Per Input Chars"}},"type":"object","required":["cents_per_input_chars"],"title":"ModelPricingInputCharacterLength"},"ModelPricingInputLength":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"input_length"},"cents_per_input_sec":{"type":"number","title":"Cents Per Input Sec"}},"type":"object","required":["cents_per_input_sec"],"title":"ModelPricingInputLength"},"ModelPricingInputTokens":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"input_tokens"},"cents_per_input_token":{"type":"number","title":"Cents Per Input Token"}},"type":"object","required":["cents_per_input_token"],"title":"ModelPricingInputTokens"},"ModelPricingOutputLength":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"output_length"},"cents_per_output_sec":{"type":"number","title":"Cents Per Output Sec"}},"type":"object","required":["cents_per_output_sec"],"title":"ModelPricingOutputLength"},"ModelPricingTime":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"time"},"cents_per_sec":{"type":"number","title":"Cents Per Sec"}},"type":"object","required":["cents_per_sec"],"title":"ModelPricingTime"},"ModelPricingTokens":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"tokens"},"cents_per_input_token":{"type":"number","title":"Cents Per Input Token"},"cents_per_output_token":{"type":"number","title":"Cents Per Output Token"},"rate_per_input_token_cached":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate Per Input Token Cached"},"rate_per_input_token_cache_write":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate Per Input Token Cache Write"}},"type":"object","required":["cents_per_input_token","cents_per_output_token"],"title":"ModelPricingTokens"},"ModelPricingUptime":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"uptime"},"cents_per_sec":{"type":"number","title":"Cents Per Sec"}},"type":"object","required":["cents_per_sec"],"title":"ModelPricingUptime"},"ModelProvider":{"type":"string","enum":["huggingface","deepinfra","cnt"],"title":"ModelProvider"},"ModelPublicityIn":{"properties":{"public":{"type":"boolean","title":"Public","description":"whether to make the model public of private"}},"type":"object","required":["public"],"title":"ModelPublicityIn"},"ModelVersionOut":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Model Name","examples":["microsoft/resnet-50"]},"version":{"type":"string","title":"Version","description":"Version identifier","examples":["06dbf5f73be4b5eca79e137e00c4825f467cd5b172c64b6c9255dc4b5a25a03a"]},"uploaded_at":{"type":"string","title":"Uploaded At","description":"Upload time","examples":["2023-01-19T21:52:03.626241+00:00"]}},"type":"object","required":["model_name","version","uploaded_at"],"title":"ModelVersionOut"},"OpenAIBatch":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object"},"endpoint":{"type":"string","title":"Endpoint"},"errors":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Errors"},"input_file_id":{"type":"string","title":"Input File Id"},"completion_window":{"type":"string","title":"Completion Window"},"status":{"type":"string","title":"Status"},"output_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output File Id"},"error_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error File Id"},"created_at":{"type":"integer","title":"Created At"},"in_progress_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"In Progress At"},"completed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completed At"},"failed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed At"},"finalizing_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Finalizing At"},"expires_at":{"type":"integer","title":"Expires At"},"expired_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expired At"},"cancelled_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancelled At"},"cancelling_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancelling At"},"request_counts":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Request Counts"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["id","object","endpoint","input_file_id","completion_window","status","created_at","expires_at"],"title":"OpenAIBatch"},"OpenAIBatchesIn":{"properties":{"input_file_id":{"type":"string","title":"Input File Id","description":"The ID of an uploaded file that contains requests for the new batch."},"endpoint":{"type":"string","enum":["/v1/chat/completions","/v1/completions"],"title":"Endpoint","description":"The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported."},"completion_window":{"type":"string","const":"24h","title":"Completion Window","description":"The time frame within which the batch should be processed. Currently only 24h is supported."},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Optional metadata to be stored with the batch."}},"type":"object","required":["input_file_id","endpoint","completion_window","metadata"],"title":"OpenAIBatchesIn"},"OpenAIChatCompletionsIn":{"properties":{"model":{"type":"string","title":"Model","description":"model name","examples":["meta-llama/Llama-2-70b-chat-hf"]},"messages":{"items":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletionToolMessage"},{"$ref":"#/components/schemas/ChatCompletionAssistantMessage"},{"$ref":"#/components/schemas/ChatCompletionUserMessage"},{"$ref":"#/components/schemas/ChatCompletionSystemMessage"}]},"type":"array","title":"Messages","description":"conversation messages: (user,assistant,tool)*,user including one system message anywhere"},"stream":{"type":"boolean","title":"Stream","description":"whether to stream the output via SSE or return the full response","default":false},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic","default":1.0},"top_p":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Top P","description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.","default":1.0},"min_p":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min P","description":"Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.","default":0.0},"top_k":{"type":"integer","exclusiveMaximum":1000.0,"minimum":0.0,"title":"Top K","description":"Sample from the best k (number of) tokens. 0 means off","default":0},"max_tokens":{"anyOf":[{"type":"integer","maximum":1000000.0,"minimum":0.0},{"type":"null"}],"title":"Max Tokens","description":"The maximum number of tokens to generate in the chat completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller."},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop","description":"up to 16 sequences where the API will stop generating further tokens"},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"number of sequences to return","default":1},"presence_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Presence Penalty","description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"frequency_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Frequency Penalty","description":"Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/ChatTools"},"type":"array"},{"type":"null"}],"title":"Tools","description":"A list of tools the model may call. Currently, only functions are supported as a tool."},"tool_choice":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/ChatTools"},{"type":"null"}],"title":"Tool Choice","description":"Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present."},"response_format":{"anyOf":[{"$ref":"#/components/schemas/TextResponseFormat"},{"$ref":"#/components/schemas/JsonObjectResponseFormat"},{"$ref":"#/components/schemas/JsonSchemaResponseFormat"},{"$ref":"#/components/schemas/RegexResponseFormat"},{"type":"null"}],"title":"Response Format","description":"The format of the response. Currently, only json is supported."},"repetition_penalty":{"type":"number","maximum":5.0,"minimum":0.01,"title":"Repetition Penalty","description":"Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)","default":1},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers."},"seed":{"anyOf":[{"type":"integer","exclusiveMaximum":1.8446744073709552e+19,"minimum":-9.223372036854776e+18},{"type":"null"}],"title":"Seed","description":"Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed."},"logprobs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Logprobs","description":"Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`."},"stream_options":{"anyOf":[{"$ref":"#/components/schemas/StreamOptions"},{"type":"null"}],"description":"streaming options"},"reasoning_effort":{"anyOf":[{"type":"string","enum":["low","medium","high","none"]},{"type":"null"}],"title":"Reasoning Effort","description":"Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports."},"reasoning":{"anyOf":[{"$ref":"#/components/schemas/ChatReasoningSettings"},{"type":"null"}],"description":"Reasoning configuration."},"prompt_cache_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Cache Key","description":"A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key."},"chat_template_kwargs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Chat Template Kwargs","description":"Chat template kwargs."}},"type":"object","required":["model","messages"],"title":"OpenAIChatCompletionsIn"},"OpenAICompletionsIn":{"properties":{"model":{"type":"string","title":"Model","description":"model name","examples":["meta-llama/Llama-2-70b-chat-hf"]},"prompt":{"anyOf":[{"type":"string"},{"items":{"type":"integer"},"type":"array"}],"title":"Prompt","description":"input prompt - a single string is currently supported"},"max_tokens":{"anyOf":[{"type":"integer","maximum":1000000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Tokens","description":"The maximum number of tokens to generate in the completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller."},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic","default":1.0},"top_p":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Top P","description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.","default":1.0},"min_p":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min P","description":"Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.","default":0.0},"top_k":{"type":"integer","exclusiveMaximum":1000.0,"minimum":0.0,"title":"Top K","description":"Sample from the best k (number of) tokens. 0 means off","default":0},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"number of sequences to return","default":1},"stream":{"type":"boolean","title":"Stream","description":"whether to stream the output via SSE or return the full response","default":false},"logprobs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Logprobs","description":"return top tokens and their log-probabilities"},"echo":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Echo","description":"return prompt as part of the respons"},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop","description":"up to 16 sequences where the API will stop generating further tokens"},"presence_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Presence Penalty","description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"frequency_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Frequency Penalty","description":"Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"response_format":{"anyOf":[{"$ref":"#/components/schemas/TextResponseFormat"},{"$ref":"#/components/schemas/JsonObjectResponseFormat"},{"$ref":"#/components/schemas/JsonSchemaResponseFormat"},{"$ref":"#/components/schemas/RegexResponseFormat"},{"type":"null"}],"title":"Response Format","description":"The format of the response. Currently, only json is supported."},"repetition_penalty":{"type":"number","maximum":5.0,"minimum":0.01,"title":"Repetition Penalty","description":"Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)","default":1},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers."},"seed":{"anyOf":[{"type":"integer","exclusiveMaximum":1.8446744073709552e+19,"minimum":-9.223372036854776e+18},{"type":"null"}],"title":"Seed","description":"Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed."},"stream_options":{"anyOf":[{"$ref":"#/components/schemas/StreamOptions"},{"type":"null"}],"description":"streaming options"},"stop_token_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Stop Token Ids","description":"List of token IDs that will stop generation when encountered"},"return_tokens_as_token_ids":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Return Tokens As Token Ids","description":"return tokens as token ids"},"prompt_cache_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Cache Key","description":"A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key."},"data":{"anyOf":[{"$ref":"#/components/schemas/CompletionMultiModalData"},{"type":"null"}],"description":"Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...')."}},"type":"object","required":["model","prompt"],"title":"OpenAICompletionsIn"},"OpenAIEmbeddingsIn":{"properties":{"service_tier":{"anyOf":[{"$ref":"#/components/schemas/ServiceTier"},{"type":"null"}],"description":"The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it)."},"model":{"type":"string","title":"Model","description":"model name","examples":["thenlper/gte-large"]},"input":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"}],"maxLength":1024,"title":"Input","description":"sequences to embed","examples":[["I like chocolate"]],"soft_required":true},"encoding_format":{"type":"string","enum":["float","base64"],"title":"Encoding Format","description":"format used when encoding","default":"float"},"dimensions":{"anyOf":[{"type":"integer","minimum":32.0},{"type":"null"}],"title":"Dimensions","description":"The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros.","examples":[1536,1024,768,512,256,128,64]}},"type":"object","required":["model","input"],"title":"OpenAIEmbeddingsIn"},"OpenAIImageData":{"properties":{"b64_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"B64 Json","description":"The base64-encoded image data"},"revised_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revised Prompt","description":"The prompt used to generate this image"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"The URL of the generated image"}},"type":"object","title":"OpenAIImageData"},"OpenAIImagesEditsIn":{"properties":{"model":{"type":"string","title":"Model","description":"The model to use."},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"The number of images to generate.","default":1},"response_format":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesResponseFormat"},{"type":"null"}],"description":"The format in which the generated images are returned. Currently only b64_json is supported.","default":"b64_json"},"size":{"type":"string","title":"Size","description":"The size of the generated images. Available sizes depend on the model.","default":"1024x1024"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help to monitor and detect abuse."},"image":{"type":"string","format":"binary","title":"Image","description":"Input image bytes for editing task","is_image":true},"prompt":{"type":"string","title":"Prompt","description":"A text description of the desired image edits.","examples":["Add a hat to the cat"]},"mask":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Mask","description":"An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.","is_image":true}},"type":"object","required":["model","image","prompt"],"title":"OpenAIImagesEditsIn"},"OpenAIImagesGenerationsIn":{"properties":{"model":{"type":"string","title":"Model","description":"The model to use for image generation.","examples":["black-forest-labs/FLUX-1-schnell"]},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"The number of images to generate.","default":1},"response_format":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesResponseFormat"},{"type":"null"}],"description":"The format in which the generated images are returned. Currently only b64_json is supported.","default":"b64_json"},"size":{"type":"string","title":"Size","description":"The size of the generated images. Available sizes depend on the model.","default":"1024x1024"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help to monitor and detect abuse."},"prompt":{"type":"string","title":"Prompt","description":"A text description of desired image(s).","examples":["A photo of an astronaut riding a horse on Mars."]},"quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quality","description":"The quality of the image that will be generated."},"style":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Style","description":"The style of the generated images."}},"type":"object","required":["model","prompt"],"title":"OpenAIImagesGenerationsIn"},"OpenAIImagesOut":{"properties":{"created":{"type":"integer","title":"Created","description":"Unix timestamp of when the images were created"},"data":{"items":{"$ref":"#/components/schemas/OpenAIImageData"},"type":"array","title":"Data","description":"List of generated images"}},"type":"object","required":["data"],"title":"OpenAIImagesOut"},"OpenAIImagesResponseFormat":{"type":"string","enum":["b64_json"],"title":"OpenAIImagesResponseFormat"},"OpenAIImagesVariationsIn":{"properties":{"model":{"type":"string","title":"Model","description":"The model to use."},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"The number of images to generate.","default":1},"response_format":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesResponseFormat"},{"type":"null"}],"description":"The format in which the generated images are returned. Currently only b64_json is supported.","default":"b64_json"},"size":{"type":"string","title":"Size","description":"The size of the generated images. Available sizes depend on the model.","default":"1024x1024"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help to monitor and detect abuse."},"image":{"type":"string","format":"binary","title":"Image","description":"Input image bytes for variation task","is_image":true}},"type":"object","required":["model","image"],"title":"OpenAIImagesVariationsIn"},"OpenAIModelOut":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"model"},"created":{"type":"integer","title":"Created"},"owned_by":{"type":"string","title":"Owned By"},"root":{"type":"string","title":"Root"},"parent":{"type":"null","title":"Parent"},"metadata":{"anyOf":[{"$ref":"#/components/schemas/ModelMetadata"},{"type":"null"}]}},"type":"object","required":["id","created","owned_by","root"],"title":"OpenAIModelOut"},"OpenAIModelsOut":{"properties":{"object":{"type":"string","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/OpenAIModelOut"},"type":"array","title":"Data"}},"type":"object","title":"OpenAIModelsOut"},"OpenAITextToSpeechIn":{"properties":{"service_tier":{"anyOf":[{"$ref":"#/components/schemas/ServiceTier"},{"type":"null"}],"description":"The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it)."},"model":{"type":"string","title":"Model","description":"model name","examples":["deepinfra/tts"]},"input":{"type":"string","title":"Input","description":"Text to convert to speech","examples":["I'm beginnin' to feel like a Rap God, Rap God\nAll my people from the front to the back nod, back nod\nNow, who thinks their arms are long enough to slap box, slap box?\nThey said I rap like a robot, so call me Rap-bot"]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice","description":"Preset voices to use for the speech."},"response_format":{"$ref":"#/components/schemas/TtsResponseFormat","description":"response format for the speech"},"speed":{"type":"number","maximum":4.0,"minimum":0.25,"title":"Speed","description":"speed of the speech","default":1.0},"extra_body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Body","description":"Extra body parameters for the model."}},"type":"object","required":["model","input"],"title":"OpenAITextToSpeechIn"},"OpenRouterDatacenter":{"properties":{"country_code":{"type":"string","title":"Country Code","description":"ISO 3166 Alpha-2 country code"}},"type":"object","required":["country_code"],"title":"OpenRouterDatacenter"},"OpenRouterModelData":{"properties":{"id":{"type":"string","title":"Id","description":"Model identifier"},"name":{"type":"string","title":"Name","description":"Human-readable model name"},"input_modalities":{"items":{"type":"string"},"type":"array","title":"Input Modalities","description":"Supported input modalities"},"output_modalities":{"items":{"type":"string"},"type":"array","title":"Output Modalities","description":"Supported output modalities"},"quantization":{"type":"string","title":"Quantization","description":"Model quantization type"},"context_length":{"type":"integer","title":"Context Length","description":"Maximum context length"},"max_output_length":{"type":"integer","title":"Max Output Length","description":"Maximum output length"},"pricing":{"$ref":"#/components/schemas/OpenRouterPricing","description":"Pricing information"},"supported_sampling_parameters":{"items":{"type":"string"},"type":"array","title":"Supported Sampling Parameters","description":"Supported sampling parameters"},"supported_features":{"items":{"type":"string"},"type":"array","title":"Supported Features","description":"Supported features"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Model description"},"openrouter":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Openrouter","description":"OpenRouter specific data"},"datacenters":{"items":{"$ref":"#/components/schemas/OpenRouterDatacenter"},"type":"array","title":"Datacenters","description":"Available datacenters"}},"type":"object","required":["id","name","input_modalities","output_modalities","quantization","context_length","max_output_length","pricing","supported_sampling_parameters","supported_features","datacenters"],"title":"OpenRouterModelData"},"OpenRouterModelsOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OpenRouterModelData"},"type":"array","title":"Data","description":"List of available models"}},"type":"object","required":["data"],"title":"OpenRouterModelsOut"},"OpenRouterPricing":{"properties":{"prompt":{"type":"string","title":"Prompt","description":"Pricing per 1 token for input"},"completion":{"type":"string","title":"Completion","description":"Pricing per 1 token for output"}},"type":"object","required":["prompt","completion"],"title":"OpenRouterPricing"},"PricingPageEntryOut":{"properties":{"model_name":{"type":"string","title":"Model Name"},"short_name":{"type":"string","title":"Short Name"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens","description":"The maximum context size of this model, if applicable"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/ModelPricingTime"},{"$ref":"#/components/schemas/ModelPricingTokens"},{"$ref":"#/components/schemas/ModelPricingInputLength"},{"$ref":"#/components/schemas/ModelPricingInputTokens"},{"$ref":"#/components/schemas/ModelPricingUptime"},{"$ref":"#/components/schemas/ModelPricingInputCharacterLength"},{"$ref":"#/components/schemas/ModelPricingImageUnits"},{"$ref":"#/components/schemas/ModelPricingOutputLength"}],"title":"Pricing"}},"type":"object","required":["model_name","short_name","pricing"],"title":"PricingPageEntryOut"},"PricingPageSectionOut":{"properties":{"section_id":{"type":"string","title":"Section Id"},"ptype":{"$ref":"#/components/schemas/PricingType"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"mf_description":{"type":"string","title":"Mf Description","description":"Model family description for this section, if applicable. Will use description from the section if not set","default":""},"entries":{"items":{"$ref":"#/components/schemas/PricingPageEntryOut"},"type":"array","title":"Entries"}},"type":"object","required":["section_id","ptype","title","description","entries"],"title":"PricingPageSectionOut"},"PricingType":{"type":"string","enum":["tokens","time","uptime","input_length","input_tokens","input_character_length","image_units","output_length"],"title":"PricingType"},"RateLimitOut":{"properties":{"rate_limit":{"type":"integer","title":"Rate Limit","description":"Per model outstanding request rate limit"},"tpm_rate_limit":{"type":"integer","title":"Tpm Rate Limit","description":"Per model token per minute rate limit"}},"type":"object","required":["rate_limit","tpm_rate_limit"],"title":"RateLimitOut"},"RateLimitRequestIn":{"properties":{"rate_limit":{"type":"integer","title":"Rate Limit"},"tpm_rate_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tpm Rate Limit"},"reason":{"type":"string","maxLength":2048,"title":"Reason"}},"type":"object","required":["rate_limit","reason"],"title":"RateLimitRequestIn"},"RegexResponseFormat":{"properties":{"type":{"type":"string","const":"regex","title":"Type","default":"regex"},"regex":{"type":"string","title":"Regex","description":"Regex pattern for structured output when type is 'regex'"}},"type":"object","required":["regex"],"title":"RegexResponseFormat"},"RequestCostItem":{"properties":{"requestId":{"type":"string","title":"Requestid"},"costNanoUsd":{"type":"integer","title":"Costnanousd"}},"type":"object","required":["requestId","costNanoUsd"],"title":"RequestCostItem"},"RequestCostQuery":{"properties":{"requestIds":{"items":{"type":"string"},"type":"array","title":"Requestids"}},"type":"object","required":["requestIds"],"title":"RequestCostQuery"},"RequestCostResponse":{"properties":{"requests":{"items":{"$ref":"#/components/schemas/RequestCostItem"},"type":"array","title":"Requests"}},"type":"object","required":["requests"],"title":"RequestCostResponse"},"ScaleSettings":{"properties":{"min_instances":{"type":"integer","title":"Min Instances","description":"Minimum number of model instances to run","default":1},"max_instances":{"type":"integer","title":"Max Instances","description":"Maximum number of model instances to run","default":1}},"type":"object","title":"ScaleSettings"},"SchemaOut":{"properties":{"variant":{"$ref":"#/components/schemas/SchemaVariant"},"schema_in":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema In"},"schema_out":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema Out"},"schema_stream":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema Stream"},"fields_in":{"items":{"$ref":"#/components/schemas/ModelFieldInfo"},"type":"array","title":"Fields In"}},"type":"object","required":["variant","fields_in"],"title":"SchemaOut"},"SchemaVariant":{"properties":{"key":{"$ref":"#/components/schemas/SchemaVariantKey"},"url":{"type":"string","title":"Url"}},"type":"object","required":["key","url"],"title":"SchemaVariant"},"SchemaVariantKey":{"type":"string","enum":["default","openai-completions","openai-chat-completions","openai-embeddings","openai-speech-to-text","openai-tts","openai-images","openai-images-variations","openai-images-edits","elevenlabs-tts","create-voice","read-voice","update-voice","delete-voice","list-voices","ai-sdk"],"title":"SchemaVariantKey"},"ScopedJWTIn":{"properties":{"api_key_name":{"type":"string","title":"Api Key Name"},"models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Models","description":"allow inference only to the specified model names"},"expires_delta":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires Delta","description":"how many seconds in the future should the token be valid for"},"expires_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires At","description":"unix timestamp when the token should expire"},"spending_limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spending Limit","description":"only allow spending that much USD until the token becomes invalid"}},"type":"object","required":["api_key_name"],"title":"ScopedJWTIn"},"ScopedJWTOut":{"properties":{"token":{"type":"string","title":"Token","description":"The newly minted scoped JWT ready for use"}},"type":"object","required":["token"],"title":"ScopedJWTOut"},"ServiceTier":{"type":"string","enum":["default","priority"],"title":"ServiceTier"},"SourceModel":{"properties":{"type":{"$ref":"#/components/schemas/SourceTypeEnum"},"civit_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Civit Url"}},"type":"object","required":["type"],"title":"SourceModel"},"SourceTypeEnum":{"type":"string","enum":["civitai"],"title":"SourceTypeEnum"},"SshKeyIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"SSH Key name"},"key":{"type":"string","maxLength":32000,"minLength":1,"title":"Key","description":"SSH Key content"}},"type":"object","required":["name","key"],"title":"SshKeyIn"},"SshKeyOut":{"properties":{"id":{"type":"string","title":"Id","description":"SSH Key ID"},"name":{"type":"string","minLength":1,"title":"Name","description":"SSH Key name"},"key":{"type":"string","minLength":1,"title":"Key","description":"SSH Key content"},"created_at":{"type":"integer","title":"Created At"}},"type":"object","required":["id","name","key"],"title":"SshKeyOut"},"StreamOptions":{"properties":{"include_usage":{"type":"boolean","title":"Include Usage","description":"whether to include usage data","default":true},"continuous_usage_stats":{"type":"boolean","title":"Continuous Usage Stats","description":"whether to include usage stats continuously with each streaming event","default":false}},"type":"object","title":"StreamOptions"},"TextResponseFormat":{"properties":{"type":{"type":"string","const":"text","title":"Type","default":"text"}},"type":"object","title":"TextResponseFormat"},"TimeDeploymentStatsOut":{"properties":{"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"},"total_time_s":{"type":"integer","title":"Total Time S","description":"total number of seconds spend in inference"},"total_amount_cents":{"type":"integer","title":"Total Amount Cents","description":"total number of cents spent"},"avg_time_ms":{"type":"number","title":"Avg Time Ms","description":"average millisecond inference time"},"avg95_time_ms":{"type":"number","title":"Avg95 Time Ms","description":"95th percentile inference time (estimated)"},"errors":{"type":"integer","title":"Errors","description":"number of errors"}},"type":"object","required":["requests","total_time_s","total_amount_cents","avg_time_ms","avg95_time_ms","errors"],"title":"TimeDeploymentStatsOut"},"TtsResponseFormat":{"type":"string","enum":["mp3","opus","flac","wav","pcm"],"title":"TtsResponseFormat","description":"Select the desired format for the speech output. Supported formats include mp3, opus, flac, wav, and pcm.","default":"wav","examples":["mp3","opus","flac","wav","pcm"]},"UpdateLoraApiRequest":{"properties":{"private":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Private"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"UpdateLoraApiRequest"},"Voice":{"properties":{"user_id":{"type":"string","title":"User Id"},"voice_id":{"type":"string","title":"Voice Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description","default":""},"created_at":{"type":"integer","title":"Created At"},"updated_at":{"type":"integer","title":"Updated At"}},"type":"object","required":["user_id","voice_id","name"],"title":"Voice"},"WebLiveMetricsOut":{"properties":{"tokens_per_second":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tokens Per Second","description":"Tokens per second"},"time_to_first_token":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Time To First Token","description":"Time to first token in seconds"},"requests_per_second":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Requests Per Second","description":"Requests per second"},"total_tflops":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Tflops","description":"Total TFLOPS"}},"type":"object","required":["tokens_per_second","time_to_first_token","requests_per_second","total_tflops"],"title":"WebLiveMetricsOut"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}} \ No newline at end of file +{"openapi":"3.1.0","info":{"title":"DeepInfra API","description":"The DeepInfra API provides serverless AI inference, custom model deployments, and GPU rentals.","version":"1.0.0"},"servers":[{"url":"https://api.deepinfra.com"}],"paths":{"/v1/metrics/live":{"get":{"tags":["Logs & Metrics"],"summary":"Get Live Metrics","description":"Get the latest values for the Live metrics section on the web front page.","operationId":"get_live_metrics_v1_metrics_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebLiveMetricsOut"}}}}}}},"/cli/version":{"get":{"tags":["Utilities"],"summary":"Cli Version","operationId":"cli_version_cli_version_get","parameters":[{"name":"version","in":"query","required":true,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me":{"get":{"tags":["Account"],"summary":"Me","operationId":"me_v1_me_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"checklist","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Checklist"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Account"],"summary":"Delete Account","operationId":"delete_account_v1_me_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Account"],"summary":"Account Update Details","operationId":"account_update_details_v1_me_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"}}}},"/v1/me/emails":{"get":{"tags":["Account"],"summary":"Account Email Values","operationId":"account_email_values_v1_me_emails_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailsOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/team_display_name":{"post":{"tags":["Account"],"summary":"Team Set Display Name","operationId":"team_set_display_name_v1_me_team_display_name_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisplayNameIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/rate_limit":{"get":{"tags":["Account"],"summary":"Account Rate Limit","operationId":"account_rate_limit_v1_me_rate_limit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/rate_limit/request":{"post":{"tags":["Account"],"summary":"Request Rate Limit Increase","operationId":"request_rate_limit_increase_v1_me_rate_limit_request_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitRequestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/deploy":{"post":{"tags":["Dedicated Models"],"summary":"Deploy Create","operationId":"deploy_create_v1_deploy_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployModelIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployResult"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Locked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/gpu_limit":{"get":{"tags":["Account"],"summary":"Account Gpu Limit","operationId":"account_gpu_limit_v1_me_gpu_limit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpuLimitOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/gpu_limit/request":{"post":{"tags":["Account"],"summary":"Request Gpu Limit Increase","operationId":"request_gpu_limit_increase_v1_me_gpu_limit_request_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpuLimitRequestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/hf/":{"post":{"tags":["Dedicated Models"],"summary":"Deploy Create Hf","operationId":"deploy_create_hf_deploy_hf__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HFModel"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployResult"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Locked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/llm/gpu_availability":{"get":{"tags":["Dedicated Models"],"summary":"Deploy Gpu Availability","operationId":"deploy_gpu_availability_deploy_llm_gpu_availability_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source","in":"query","required":false,"schema":{"type":"string","default":"","title":"Source"}},{"name":"base_model","in":"query","required":false,"schema":{"type":"string","default":"","title":"Base Model"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployGPUAvailability"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/llm/suggest_name":{"get":{"tags":["Dedicated Models"],"summary":"Deploy Llm Suggest Name","operationId":"deploy_llm_suggest_name_deploy_llm_suggest_name_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"query","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelNameSuggestionOut"}}}},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/llm":{"post":{"tags":["Dedicated Models"],"summary":"Deploy Create Llm","operationId":"deploy_create_llm_deploy_llm_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployLLMIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentOut"}}}},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Payment Required"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"}}}},"/deploy/list/":{"get":{"tags":["Dedicated Models"],"summary":"Deploy List","operationId":"deploy_list_deploy_list__get","deprecated":true,"security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted","title":"Status"},"description":"A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentOut"},"title":"Response Deploy List Deploy List Get"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/list":{"get":{"tags":["Dedicated Models"],"summary":"Deploy List","operationId":"deploy_list_deploy_list_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted","title":"Status"},"description":"A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentOut"},"title":"Response Deploy List Deploy List Get"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/stats":{"get":{"tags":["Dedicated Models"],"summary":"Deployment Stats","operationId":"deployment_stats_deploy_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)","title":"From"},"description":"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)"},{"name":"to","in":"query","required":false,"schema":{"type":"string","description":"end of period, unix ts or now-relative, check from, defaults to now","default":"now","title":"To"},"description":"end of period, unix ts or now-relative, check from, defaults to now"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentMainStatsOut"},"title":"Response Deployment Stats Deploy Stats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}":{"get":{"tags":["Dedicated Models"],"summary":"Deploy Status","operationId":"deploy_status_deploy__deploy_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Dedicated Models"],"summary":"Deploy Update","operationId":"deploy_update_deploy__deploy_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployLLMUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployStatusOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Dedicated Models"],"summary":"Deploy Delete","operationId":"deploy_delete_deploy__deploy_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployDelete"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}/stats":{"get":{"tags":["Dedicated Models"],"summary":"Deploy Stats","operationId":"deploy_stats_deploy__deploy_id__stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)","title":"From"},"description":"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)"},{"name":"to","in":"query","required":false,"schema":{"type":"string","description":"end of period, unix ts or now-relative, check from, defaults to now","default":"now","title":"To"},"description":"end of period, unix ts or now-relative, check from, defaults to now"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentStatsOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Gone"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}/stats2":{"get":{"tags":["Dedicated Models"],"summary":"Deploy Detailed Stats","operationId":"deploy_detailed_stats_deploy__deploy_id__stats2_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period, unix ts or 'now-5h', supported units s, m, h, d, w","title":"From"},"description":"start of period, unix ts or 'now-5h', supported units s, m, h, d, w"},{"name":"to","in":"query","required":false,"schema":{"type":"string","description":"end of period, unix ts or now-relative, check from, defaults to now","default":"now","title":"To"},"description":"end of period, unix ts or now-relative, check from, defaults to now"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetailedDeploymentStatsOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Gone"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}/stop":{"post":{"tags":["Dedicated Models"],"summary":"Deploy Stop","description":"Stop a running deployment. Terminates pods. Can be restarted later.","operationId":"deploy_stop_deploy__deploy_id__stop_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployStatusOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}/start":{"post":{"tags":["Dedicated Models"],"summary":"Deploy Start","description":"Start a stopped deployment. Re-creates pods via auto-scaling.","operationId":"deploy_start_deploy__deploy_id__start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployStatusOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/private/list":{"get":{"tags":["Models"],"summary":"Private Models List","operationId":"private_models_list_models_private_list_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelOut"},"title":"Response Private Models List Models Private List Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lora-model":{"post":{"tags":["LoRA Adapters"],"summary":"Upload Lora Model","operationId":"upload_lora_model_lora_model_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoraModelUploadIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/lora-model/{lora_model_name}":{"delete":{"tags":["LoRA Adapters"],"summary":"Delete Lora Model","operationId":"delete_lora_model_lora_model__lora_model_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lora_model_name","in":"path","required":true,"schema":{"type":"string","title":"Lora Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/model-families/names":{"get":{"tags":["Models"],"summary":"Model Families Names","operationId":"model_families_names_model_families_names_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response Model Families Names Model Families Names Get"}}}}}}},"/model-families/{family_name}":{"get":{"tags":["Models"],"summary":"Model Family","operationId":"model_family_model_families__family_name__get","parameters":[{"name":"family_name","in":"path","required":true,"schema":{"type":"string","title":"Family Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelFamilyOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/list":{"get":{"tags":["Models"],"summary":"Models List","operationId":"models_list_models_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ModelOut"},"type":"array","title":"Response Models List Models List Get"}}}}}}},"/models/deployment/list":{"get":{"tags":["Models"],"summary":"Models Deployment List","operationId":"models_deployment_list_models_deployment_list_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelOut"},"title":"Response Models Deployment List Models Deployment List Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/lora/list":{"get":{"tags":["Models"],"summary":"Models Lora List","operationId":"models_lora_list_models_lora_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ModelOut"},"type":"array","title":"Response Models Lora List Models Lora List Get"}}}}}}},"/openrouter/models":{"get":{"tags":["Models"],"summary":"Openrouter Models","operationId":"openrouter_models_openrouter_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenRouterModelsOut"}}}}}}},"/models/{model_name}/versions":{"get":{"tags":["Models"],"summary":"Model Versions","operationId":"model_versions_models__model_name__versions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelVersionOut"},"title":"Response Model Versions Models Model Name Versions Get"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/{model_name}/publicity":{"post":{"tags":["Models"],"summary":"Model Publicity","operationId":"model_publicity_models__model_name__publicity_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelPublicityIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/{model_name}/meta":{"post":{"tags":["Models"],"summary":"Model Meta Update","operationId":"model_meta_update_models__model_name__meta_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelMetaIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/{model_name}":{"delete":{"tags":["Models"],"summary":"Model Delete","operationId":"model_delete_models__model_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"version","in":"query","required":true,"schema":{"type":"string","description":"delete a particular version, pass 'ALL' to wipe everything","title":"Version"},"description":"delete a particular version, pass 'ALL' to wipe everything"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Models"],"summary":"Models Info","operationId":"models_info_models__model_name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelInfoOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models/featured":{"get":{"tags":["Models"],"summary":"Models Featured","operationId":"models_featured_models_featured_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ModelOut"},"type":"array","title":"Response Models Featured Models Featured Get"}}}}}}},"/models/{model_name}/schema/{variantKey}":{"get":{"tags":["Models"],"summary":"Model Schema","operationId":"model_schema_models__model_name__schema__variantKey__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"variantKey","in":"path","required":true,"schema":{"$ref":"#/components/schemas/SchemaVariantKey"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaOut"}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Locked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inference/deploy/{deploy_id}":{"post":{"tags":["Inference"],"summary":"Inference Deploy","operationId":"inference_deploy_v1_inference_deploy__deploy_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/inference/{model_name}":{"post":{"tags":["Inference"],"summary":"Inference Model","operationId":"inference_model_v1_inference__model_name__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"model version to run inference against","title":"Version"},"description":"model version to run inference against"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Locked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/files":{"get":{"tags":["Files & Batches"],"summary":"List Files","operationId":"list_files_v1_files_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"purpose","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"}},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Files & Batches"],"summary":"Openai Files","operationId":"openai_files_v1_files_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_files_v1_files_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/batches":{"get":{"tags":["Files & Batches"],"summary":"Retrieve Openai Batches","operationId":"retrieve_openai_batches_v1_batches_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"after","in":"query","required":true,"schema":{"type":"string","title":"After"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Files & Batches"],"summary":"Create Openai Batch","operationId":"create_openai_batch_v1_batches_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIBatchesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIBatch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/batches/{batch_id}":{"get":{"tags":["Files & Batches"],"summary":"Retrieve Openai Batch","operationId":"retrieve_openai_batch_v1_batches__batch_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anthropic/v1/messages":{"post":{"tags":["Chat Completions"],"summary":"Anthropic Messages","operationId":"anthropic_messages_anthropic_v1_messages_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"anthropic-version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anthropic-Version"}},{"name":"anthropic-beta","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anthropic-Beta"}},{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessagesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anthropic/v1/messages/count_tokens":{"post":{"tags":["Chat Completions"],"summary":"Anthropic Messages Count Tokens","operationId":"anthropic_messages_count_tokens_anthropic_v1_messages_count_tokens_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicTokenCountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models":{"get":{"tags":["Models"],"summary":"Openai Models","operationId":"openai_models_v1_models_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIModelsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/images/generations":{"post":{"tags":["Image Generation"],"summary":"Openai Images Generations","description":"Generate image using OpenAI Images API","operationId":"openai_images_generations_v1_images_generations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesGenerationsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/images/variations":{"post":{"tags":["Image Generation"],"summary":"Openai Images Variations","description":"Generate a similar image using OpenAI Images Variations API","operationId":"openai_images_variations_v1_images_variations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_images_variations_v1_images_variations_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/images/edits":{"post":{"tags":["Image Generation"],"summary":"Openai Images Edits","description":"Edit image using OpenAI Images Edits API","operationId":"openai_images_edits_v1_images_edits_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_images_edits_v1_images_edits_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIImagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/feedback":{"post":{"tags":["Utilities"],"summary":"Submit Feedback","description":"Submit feedback","operationId":"submit_feedback_v1_feedback_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audio/speech":{"post":{"tags":["Audio"],"summary":"Openai Audio Speech","operationId":"openai_audio_speech_v1_audio_speech_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAITextToSpeechIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audio/transcriptions":{"post":{"tags":["Audio"],"summary":"Openai Audio Transcriptions","operationId":"openai_audio_transcriptions_v1_audio_transcriptions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_audio_transcriptions_v1_audio_transcriptions_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audio/translations":{"post":{"tags":["Audio"],"summary":"Openai Audio Translations","operationId":"openai_audio_translations_v1_audio_translations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_openai_audio_translations_v1_audio_translations_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/logs/query":{"get":{"tags":["Logs & Metrics"],"summary":"Logs Query","description":"Query inference logs.\n* Without timestamps (from/to) returns last `limit` messages (in last month).\n* With `from` only, returns first `limit` messages after `from` (inclusive).\n* With `to` only, returns last `limit` messages before `to` (inclusive).\n* With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.\n* `from` and `to` should be no more than a month apart.","operationId":"logs_query_v1_logs_query_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"query","required":true,"schema":{"type":"string","description":"the deploy id to get the logs from","title":"Deploy Id"},"description":"the deploy id to get the logs from"},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"start of period, in fractional seconds since unix epoch (inclusive)","title":"From"},"description":"start of period, in fractional seconds since unix epoch (inclusive)"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"end of period, in fractional seconds since unix epoch (exclusive)","title":"To"},"description":"end of period, in fractional seconds since unix epoch (exclusive)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"how many items to return at most (default 100, in [1, 1000])","default":100,"title":"Limit"},"description":"how many items to return at most (default 100, in [1, 1000])"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogQueryOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/deployment_logs/query":{"get":{"tags":["Logs & Metrics"],"summary":"Deployment Logs Query","description":"Query deployment logs.\n* Without timestamps (from/to) returns last `limit` messages (in last month).\n* With `from` only, returns first `limit` messages after `from` (inclusive).\n* With `to` only, returns last `limit` messages before `to` (inclusive).\n* With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.\n* `from` and `to` should be no more than a month apart.","operationId":"deployment_logs_query_v1_deployment_logs_query_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"query","required":true,"schema":{"type":"string","description":"the deploy id to get the logs from","title":"Deploy Id"},"description":"the deploy id to get the logs from"},{"name":"pod_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"the pod name to get the logs from","title":"Pod Name"},"description":"the pod name to get the logs from"},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"start of period, in fractional seconds since unix epoch (inclusive)","title":"From"},"description":"start of period, in fractional seconds since unix epoch (inclusive)"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"end of period, in fractional seconds since unix epoch (exclusive)","title":"To"},"description":"end of period, in fractional seconds since unix epoch (exclusive)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"how many items to return at most (default 100, in [1, 1000])","default":100,"title":"Limit"},"description":"how many items to return at most (default 100, in [1, 1000])"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentLogQueryOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voices":{"get":{"tags":["Text to Speech"],"summary":"Get Voices","description":"Get available voices for a given user","operationId":"get_voices_v1_voices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVoicesOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/text-to-speech/{voice_id}/stream":{"post":{"tags":["Text to Speech"],"summary":"Text To Speech Stream","operationId":"text_to_speech_stream_v1_text_to_speech__voice_id__stream_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"name":"output_format","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Format"},"example":"wav"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElevenLabsTextToSpeechIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/text-to-speech/{voice_id}":{"post":{"tags":["Text to Speech"],"summary":"Text To Speech","operationId":"text_to_speech_v1_text_to_speech__voice_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"name":"output_format","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Format"},"example":"wav"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElevenLabsTextToSpeechIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voices/{voice_id}":{"get":{"tags":["Text to Speech"],"summary":"Get Voice","description":"Get a voice by its id","operationId":"get_voice_v1_voices__voice_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Voice"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Text to Speech"],"summary":"Delete Voice","operationId":"delete_voice_v1_voices__voice_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voices/add":{"post":{"tags":["Text to Speech"],"summary":"Create Voice","description":"Create a new voice","operationId":"create_voice_v1_voices_add_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_voice_v1_voices_add_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Voice"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voices/{voice_id}/edit":{"post":{"tags":["Text to Speech"],"summary":"Update Voice","operationId":"update_voice_v1_voices__voice_id__edit_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_update_voice_v1_voices__voice_id__edit_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Voice"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/lora/create":{"post":{"tags":["LoRA Adapters"],"summary":"Create Lora","operationId":"create_lora_v1_lora_create_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLoraApiRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/lora/{lora_name}/status":{"get":{"tags":["LoRA Adapters"],"summary":"Get Lora Status","operationId":"get_lora_status_v1_lora__lora_name__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lora_name","in":"path","required":true,"schema":{"type":"string","title":"Lora Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/lora/{lora_name}":{"get":{"tags":["LoRA Adapters"],"summary":"Get Lora","operationId":"get_lora_v1_lora__lora_name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lora_name","in":"path","required":true,"schema":{"type":"string","title":"Lora Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["LoRA Adapters"],"summary":"Update Lora","operationId":"update_lora_v1_lora__lora_name__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lora_name","in":"path","required":true,"schema":{"type":"string","title":"Lora Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLoraApiRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["LoRA Adapters"],"summary":"Delete Lora","operationId":"delete_lora_v1_lora__lora_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lora_name","in":"path","required":true,"schema":{"type":"string","title":"Lora Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/model/{model_name}/loras":{"get":{"tags":["LoRA Adapters"],"summary":"Get Model Loras","operationId":"get_model_loras_v1_model__model_name__loras_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/user/loras":{"get":{"tags":["LoRA Adapters"],"summary":"Get User Loras","operationId":"get_user_loras_v1_user_loras_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/containers/params":{"get":{"tags":["GPU Rentals"],"summary":"Container Rentals Get Params","operationId":"container_rentals_get_params_v1_containers_params_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/containers/gpu_availability":{"get":{"tags":["GPU Rentals"],"summary":"Rent Gpu Availability","operationId":"rent_gpu_availability_v1_containers_gpu_availability_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source","in":"query","required":false,"schema":{"type":"string","default":"","title":"Source"}},{"name":"base_model","in":"query","required":false,"schema":{"type":"string","default":"","title":"Base Model"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployGPUAvailability"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/containers":{"post":{"tags":["GPU Rentals"],"summary":"Container Rentals Start","operationId":"container_rentals_start_v1_containers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerRentalStartIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerRentalStartOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Too Many Requests"}}},"get":{"tags":["GPU Rentals"],"summary":"Container Rentals List","operationId":"container_rentals_list_v1_containers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"enum":["active","inactive"],"type":"string","description":"whether to return active or inactive containers","default":"active","title":"State"},"description":"whether to return active or inactive containers"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContainerRentalOut"},"title":"Response Container Rentals List V1 Containers Get"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"}}}},"/v1/containers/{container_id}":{"get":{"tags":["GPU Rentals"],"summary":"Container Rentals Get","operationId":"container_rentals_get_v1_containers__container_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"container_id","in":"path","required":true,"schema":{"type":"string","title":"Container Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerRentalOut"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["GPU Rentals"],"summary":"Container Rentals Update","operationId":"container_rentals_update_v1_containers__container_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"container_id","in":"path","required":true,"schema":{"type":"string","title":"Container Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerRentalUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"}}},"delete":{"tags":["GPU Rentals"],"summary":"Container Rentals Delete","operationId":"container_rentals_delete_v1_containers__container_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"container_id","in":"path","required":true,"schema":{"type":"string","title":"Container Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/request-costs":{"post":{"tags":["Logs & Metrics"],"summary":"Get Request Costs","operationId":"get_request_costs_v1_request_costs_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCostQuery"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCostResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/hardware":{"get":{"tags":["Models"],"summary":"Get Hardware","operationId":"get_hardware_v2_hardware_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model","in":"query","required":true,"schema":{"type":"string","description":"Model name (NVIDIA NemoClaw format)","title":"Model"},"description":"Model name (NVIDIA NemoClaw format)"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HardwareResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/completions":{"post":{"tags":["Text Completions"],"summary":"Openai Completions","operationId":"openai_completions_v1_completions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAICompletionsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/completions":{"post":{"tags":["Chat Completions"],"summary":"Openai Chat Completions","operationId":"openai_chat_completions_v1_chat_completions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIChatCompletionsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/embeddings":{"post":{"tags":["Embeddings"],"summary":"Openai Embeddings","operationId":"openai_embeddings_v1_embeddings_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-deepinfra-source","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Source"}},{"name":"user-agent","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User-Agent"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIEmbeddingsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/github/login":{"get":{"tags":["Authentication"],"summary":"Github Login","description":"Initiate github SSO login flow. Callback is /github/callback","operationId":"github_login_github_login_get","parameters":[{"name":"login_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Login Id"}},{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},{"name":"deal","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal"}},{"name":"ti_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ti Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/okta/login":{"get":{"tags":["Authentication"],"summary":"Okta Login","operationId":"okta_login_okta_login_get","parameters":[{"name":"team_id","in":"query","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},{"name":"login_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Login Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/github/cli/login":{"get":{"tags":["Authentication"],"summary":"Github Cli Login","description":"deepctl is calling this request waiting for auth token during login.\nThe token is stored in /github/callback","operationId":"github_cli_login_github_cli_login_get","parameters":[{"name":"login_id","in":"query","required":true,"schema":{"type":"string","title":"Login Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-tokens":{"get":{"tags":["Authentication"],"summary":"Get Api Tokens","operationId":"get_api_tokens_v1_api_tokens_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiToken"},"title":"Response Get Api Tokens V1 Api Tokens Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Authentication"],"summary":"Create Api Token","operationId":"create_api_token_v1_api_tokens_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToken"}}}},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-tokens/{api_token}":{"get":{"tags":["Authentication"],"summary":"Get Api Token","operationId":"get_api_token_v1_api_tokens__api_token__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"api_token","in":"path","required":true,"schema":{"type":"string","title":"Api Token"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToken"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Authentication"],"summary":"Delete Api Token","operationId":"delete_api_token_v1_api_tokens__api_token__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"api_token","in":"path","required":true,"schema":{"type":"string","title":"Api Token"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-tokens/{api_token}/vercel_export":{"post":{"tags":["Authentication"],"summary":"Export Api Token To Vercel","operationId":"export_api_token_to_vercel_v1_api_tokens__api_token__vercel_export_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"api_token","in":"path","required":true,"schema":{"type":"string","title":"Api Token"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenVercelExportIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/scoped-jwt":{"post":{"tags":["Authentication"],"summary":" Create Scoped Jwt","operationId":"_create_scoped_jwt_v1_scoped_jwt_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedJWTIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopedJWTOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Authentication"],"summary":"Inspect Scoped Jwt","operationId":"inspect_scoped_jwt_v1_scoped_jwt_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"jwtoken","in":"query","required":true,"schema":{"type":"string","title":"Jwtoken"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InspectScopedJWTOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ssh_keys":{"get":{"tags":["Authentication"],"summary":"Get Ssh Keys","operationId":"get_ssh_keys_v1_ssh_keys_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SshKeyOut"},"title":"Response Get Ssh Keys V1 Ssh Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Authentication"],"summary":"Create Ssh Key","operationId":"create_ssh_key_v1_ssh_keys_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SshKeyIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SshKeyOut"}}}},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ssh_keys/{ssh_key_id}":{"delete":{"tags":["Authentication"],"summary":"Delete Ssh Key","operationId":"delete_ssh_key_v1_ssh_keys__ssh_key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ssh_key_id","in":"path","required":true,"schema":{"type":"string","title":"Ssh Key Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents":{"post":{"tags":["Agents"],"summary":"Openclaw Create","operationId":"openclaw_create_v1_agents_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenClawCreateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenClawCreateOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Payment Required"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Service Unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Agents"],"summary":"Openclaw List","operationId":"openclaw_list_v1_agents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"enum":["active","inactive","all"],"type":"string","description":"Which instances to return: active, inactive, or all (both)","default":"active","title":"State"},"description":"Which instances to return: active, inactive, or all (both)"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OpenClawInstanceOut"},"title":"Response Openclaw List V1 Agents Get"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/catalog":{"get":{"tags":["Agents"],"summary":"Openclaw Catalog","operationId":"openclaw_catalog_v1_agents_catalog_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenClawCatalogOut"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{instance_id}":{"get":{"tags":["Agents"],"summary":"Openclaw Get","operationId":"openclaw_get_v1_agents__instance_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenClawInstanceOut"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Agents"],"summary":"Openclaw Update","operationId":"openclaw_update_v1_agents__instance_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenClawUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Agents"],"summary":"Openclaw Delete","operationId":"openclaw_delete_v1_agents__instance_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{instance_id}/launch_token":{"post":{"tags":["Agents"],"summary":"Openclaw Launch Token","description":"Mint a single-use launch URL for the dashboard.\n\nCalled by the launcher page right when readyz flips ready. The launch URL\nis used as a top-level navigation; /launch then sets the oc_auth cookie\nand 302s into the proxied dashboard.\n\nThe user's bearer token is stashed in Redis under the token's jti and\nretrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of\nthe URL and out of any signed payload while preserving the existing proxy\nauth flow (oc_auth cookie value = bearer token).\n\nRefuses instances whose agent_type has has_dashboard=False (e.g. hermes).","operationId":"openclaw_launch_token_v1_agents__instance_id__launch_token_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenClawLaunchTokenOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{instance_id}/stop":{"post":{"tags":["Agents"],"summary":"Openclaw Stop","operationId":"openclaw_stop_v1_agents__instance_id__stop_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{instance_id}/start":{"post":{"tags":["Agents"],"summary":"Openclaw Start","operationId":"openclaw_start_v1_agents__instance_id__start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{instance_id}/update":{"post":{"tags":["Agents"],"summary":"Openclaw Update Version","operationId":"openclaw_update_version_v1_agents__instance_id__update_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{instance_id}/backups":{"get":{"tags":["Agents"],"summary":"Openclaw List Backups","operationId":"openclaw_list_backups_v1_agents__instance_id__backups_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OpenClawBackupOut"},"title":"Response Openclaw List Backups V1 Agents Instance Id Backups Get"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{instance_id}/backup":{"post":{"tags":["Agents"],"summary":"Openclaw Trigger Backup","operationId":"openclaw_trigger_backup_v1_agents__instance_id__backup_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{instance_id}/backups/{backup_id}/restore":{"post":{"tags":["Agents"],"summary":"Openclaw Restore Backup","operationId":"openclaw_restore_backup_v1_agents__instance_id__backups__backup_id__restore_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"backup_id","in":"path","required":true,"schema":{"type":"string","title":"Backup Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/checklist":{"get":{"summary":"Get Checklist","operationId":"get_checklist_payment_checklist_get","parameters":[{"name":"compute_owed","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Compute Owed"}},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checklist"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}},"/payment/config":{"get":{"summary":"Get Config","operationId":"get_config_payment_config_get","parameters":[{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]},"post":{"summary":"Set Config","operationId":"set_config_payment_config_post","parameters":[{"name":"session","in":"cookie","schema":{"type":"String"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}},"/payment/billing-portal":{"get":{"summary":"Billing Portal","operationId":"billing_portal_payment_billing_portal_get","parameters":[{"name":"return_url","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return Url"}},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPortalOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}},"/payment/invoices":{"get":{"summary":"List Invoices","operationId":"list_invoices_payment_invoices_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Starting After"}},{"name":"invoice_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Type"}},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}},"/payment/usage":{"get":{"summary":"Usage","operationId":"usage_payment_usage_get","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format","title":"From"},"description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"end of period (if missing a single month marked by from is return), same format as from","title":"To"},"description":"end of period (if missing a single month marked by from is return), same format as from"},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}},"/payment/usage/tokens":{"get":{"summary":"Usage Tokens","operationId":"usage_tokens_payment_usage_tokens_get","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format","title":"From"},"description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"end of period (if missing a single month marked by from is return), same format as from","title":"To"},"description":"end of period (if missing a single month marked by from is return), same format as from"},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}},"/payment/usage/rent":{"get":{"summary":"Usage Rent","operationId":"usage_rent_payment_usage_rent_get","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"integer","description":"start of period, in seconds since unix epoch","title":"From"},"description":"start of period, in seconds since unix epoch"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"end of period, in seconds since unix epoch","title":"To"},"description":"end of period, in seconds since unix epoch"},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageRentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}},"/payment/usage/{api_token}":{"get":{"summary":"Usage Api Token","operationId":"usage_api_token_payment_usage__api_token__get","parameters":[{"name":"api_token","in":"path","required":true,"schema":{"type":"string","title":"Api Token"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format","title":"From"},"description":"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"end of period (if missing a single month marked by from is return), same format as from","title":"To"},"description":"end of period (if missing a single month marked by from is return), same format as from"},{"name":"session","in":"cookie","schema":{"type":"String"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}},"/payment/deepstart/application":{"post":{"summary":"Deepstart Apply","operationId":"deepstart_apply_payment_deepstart_application_post","parameters":[{"name":"session","in":"cookie","schema":{"type":"String"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepStartApplicationIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepStartApplicationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}},"/payment/funds":{"post":{"summary":"Add Funds","operationId":"add_funds_payment_funds_post","parameters":[{"name":"use_checkout","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Use Checkout"}},{"name":"session","in":"cookie","schema":{"type":"String"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFundsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFundsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}},"/payment/topup":{"post":{"summary":"Setup Topup","operationId":"setup_topup_payment_topup_post","parameters":[{"name":"session","in":"cookie","schema":{"type":"String"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}],"tags":["Billing"]}}},"components":{"schemas":{"AddFundsIn":{"properties":{"amount":{"type":"integer","title":"Amount","description":"Amount to add in cents"}},"type":"object","required":["amount"],"title":"AddFundsIn"},"AddFundsOut":{"properties":{"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url","description":"Stripe-hosted invoice URL to complete payment. Non-null when no saved payment method is on file."}},"type":"object","title":"AddFundsOut"},"BillingAddress":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"line1":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line1"},"line2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line2"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"}},"type":"object","title":"BillingAddress"},"BillingPortalOut":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"BillingPortalOut"},"Checklist":{"properties":{"email":{"type":"boolean","title":"Email","default":false},"billing_address":{"type":"boolean","title":"Billing Address","default":false},"payment_method":{"type":"boolean","title":"Payment Method","default":false},"suspended":{"type":"boolean","title":"Suspended","default":false},"overdue_invoices":{"type":"number","title":"Overdue Invoices","default":0.0},"last_checked":{"type":"integer","title":"Last Checked","default":0},"stripe_balance":{"type":"number","title":"Stripe Balance","description":"Negative value indicates funds ready-to-spend. Positive value indicates money owed"},"recent":{"type":"number","title":"Recent","description":"usage since most recent invoice"},"limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit"},"suspend_reason":{"anyOf":[{"$ref":"#/components/schemas/SuspendReason"},{"type":"null"}]},"topup":{"type":"boolean","title":"Topup","default":false},"topup_amount":{"type":"integer","title":"Topup Amount","default":0},"topup_threshold":{"type":"integer","title":"Topup Threshold","default":0},"topup_failed":{"type":"boolean","title":"Topup Failed","default":false},"billing_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Type"}},"type":"object","required":["stripe_balance","recent","limit","suspend_reason"],"title":"Checklist"},"ConfigIn":{"properties":{"limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit","description":"Set usage limit (in USD). Negative means no limit.null/not-set means don't change it"}},"type":"object","title":"ConfigIn"},"ConfigOut":{"properties":{"limit":{"type":"number","title":"Limit","description":"Spending limit (in USD). Negative means no limit"}},"type":"object","required":["limit"],"title":"ConfigOut"},"DeepStartApplicationIn":{"properties":{"id":{"type":"string","title":"Id"},"uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uid"},"company":{"type":"string","title":"Company"},"ceo":{"type":"string","title":"Ceo"},"funding":{"type":"string","title":"Funding"},"founded_on":{"type":"string","title":"Founded On"},"website":{"type":"string","title":"Website"},"created_at":{"type":"integer","title":"Created At"},"status":{"type":"string","title":"Status","default":"pending"},"deal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal"}},"type":"object","required":["company","ceo","funding","founded_on","website"],"title":"DeepStartApplicationIn"},"DeepStartApplicationOut":{"properties":{"id":{"type":"string","title":"Id"},"uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uid"},"company":{"type":"string","title":"Company"},"ceo":{"type":"string","title":"Ceo"},"funding":{"type":"string","title":"Funding"},"founded_on":{"type":"string","title":"Founded On"},"website":{"type":"string","title":"Website"},"created_at":{"type":"integer","title":"Created At"},"status":{"type":"string","title":"Status","default":"pending"},"deal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["company","ceo","funding","founded_on","website"],"title":"DeepStartApplicationOut"},"DiscountMeta":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"description of the discount, only for display purposes"}},"type":"object","required":["name"],"title":"DiscountMeta"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvoiceListItem":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"total":{"type":"integer","title":"Total"},"amount_due":{"type":"integer","title":"Amount Due"},"created":{"type":"integer","title":"Created"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"invoice_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Type"},"hosted_invoice_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hosted Invoice Url"},"invoice_pdf":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Pdf"}},"type":"object","required":["id","status","total","amount_due","created"],"title":"InvoiceListItem"},"InvoicesOut":{"properties":{"invoices":{"items":{"$ref":"#/components/schemas/InvoiceListItem"},"type":"array","title":"Invoices"},"has_more":{"type":"boolean","title":"Has More"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["invoices","has_more","next_cursor"],"title":"InvoicesOut"},"ModelMeta":{"properties":{"provider":{"type":"string","title":"Provider"},"model_name":{"type":"string","title":"Model Name"},"task":{"type":"string","title":"Task"},"plan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Id"},"private":{"type":"boolean","title":"Private","default":false}},"type":"object","required":["provider","model_name","task"],"title":"ModelMeta"},"PaymentMethodBankInfo":{"properties":{"bank_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Name"},"last4":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last4"}},"type":"object","title":"PaymentMethodBankInfo"},"PaymentMethodCardInfo":{"properties":{"brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand"},"last4":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last4"}},"type":"object","title":"PaymentMethodCardInfo"},"PaymentMethodCashAppInfo":{"properties":{"cashtag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cashtag"}},"type":"object","title":"PaymentMethodCashAppInfo"},"PaymentMethodInfo":{"properties":{"type":{"type":"string","title":"Type"},"card":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethodCardInfo"},{"type":"null"}]},"us_bank_account":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethodBankInfo"},{"type":"null"}]},"cashapp":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethodCashAppInfo"},{"type":"null"}]}},"type":"object","required":["type"],"title":"PaymentMethodInfo"},"SuspendReason":{"type":"string","enum":["balance","payment-method","overdue-invoices","limit-reached","admin","bad-cc","missing-address"],"title":"SuspendReason"},"TimeInterval":{"properties":{"fr":{"type":"integer","title":"Fr","default":0},"to":{"type":"integer","title":"To","default":4000000000000}},"type":"object","title":"TimeInterval","description":"Inclusive, in ms"},"TopUpIn":{"properties":{"amount":{"type":"integer","title":"Amount","description":"Amount to top up in cents","default":0},"threshold":{"type":"integer","title":"Threshold","description":"Top up threshold in cents, if balance goes below this value, top up will be triggered","default":0},"enabled":{"type":"boolean","title":"Enabled","description":"If true, top up will be triggered when balance goes below threshold","default":true}},"type":"object","title":"TopUpIn"},"UsageItem":{"properties":{"model":{"$ref":"#/components/schemas/ModelMeta"},"units":{"type":"integer","title":"Units","description":"billed seconds or tokens"},"rate":{"type":"number","title":"Rate","description":"rate in cents/sec or cents per token"},"cost":{"type":"integer","title":"Cost","description":"model cost in cents"},"pricing_type":{"type":"string","title":"Pricing Type","description":"pricing type"},"interval":{"$ref":"#/components/schemas/TimeInterval","description":"time interval with this particular pricing"},"discount":{"anyOf":[{"$ref":"#/components/schemas/DiscountMeta"},{"type":"null"}],"description":"discount meta, only if pricing_type is discount"}},"type":"object","required":["model","units","rate","cost","pricing_type","interval"],"title":"UsageItem"},"UsageMonth":{"properties":{"period":{"type":"string","title":"Period","description":"YYYY.MM formatted period"},"interval":{"$ref":"#/components/schemas/TimeInterval","description":"time interval in this period"},"items":{"items":{"$ref":"#/components/schemas/UsageItem"},"type":"array","title":"Items"},"total_cost":{"type":"integer","title":"Total Cost","description":"total cost for all items in cents"},"invoice_id":{"type":"string","title":"Invoice Id","description":"Stripe Invoice ID, or EMPTY|NOT_FINAL","default":"NOT_FINAL"}},"type":"object","required":["period","interval","items","total_cost"],"title":"UsageMonth"},"UsageOut":{"properties":{"months":{"items":{"$ref":"#/components/schemas/UsageMonth"},"type":"array","title":"Months"},"initial_month":{"type":"string","title":"Initial Month","description":"The first month for this account"}},"type":"object","required":["months","initial_month"],"title":"UsageOut"},"UsageRentOut":{"properties":{"id_to_duration":{"additionalProperties":{"type":"integer"},"type":"object","title":"Id To Duration","description":"container id to duration in seconds"}},"type":"object","required":["id_to_duration"],"title":"UsageRentOut"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"AgentInstanceState":{"type":"string","enum":["creating","starting","running","stopping","stopped","failed","deleted"],"title":"AgentInstanceState"},"AnthropicMessagesIn":{"properties":{"model":{"type":"string","title":"Model"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"system":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/AnthropicSystemContent"},"type":"array"},{"type":"null"}],"title":"System"},"stop_sequences":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop Sequences"},"stream":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream","default":false},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":1.0},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"},"top_k":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Top K"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/AnthropicTool"},"type":"array"},{"type":"null"}],"title":"Tools"},"tool_choice":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Choice"},"thinking":{"anyOf":[{"$ref":"#/components/schemas/AnthropicThinkingConfig"},{"type":"null"}]}},"type":"object","required":["model","messages"],"title":"AnthropicMessagesIn"},"AnthropicSystemContent":{"properties":{"type":{"type":"string","const":"text","title":"Type"},"text":{"type":"string","title":"Text"}},"type":"object","required":["type","text"],"title":"AnthropicSystemContent"},"AnthropicThinkingConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","title":"AnthropicThinkingConfig"},"AnthropicTokenCountRequest":{"properties":{"model":{"type":"string","title":"Model"},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"system":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/AnthropicSystemContent"},"type":"array"},{"type":"null"}],"title":"System"},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/AnthropicTool"},"type":"array"},{"type":"null"}],"title":"Tools"},"thinking":{"anyOf":[{"$ref":"#/components/schemas/AnthropicThinkingConfig"},{"type":"null"}]},"tool_choice":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Choice"}},"type":"object","required":["model","messages"],"title":"AnthropicTokenCountRequest"},"AnthropicTool":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"}},"type":"object","required":["name","input_schema"],"title":"AnthropicTool"},"ApiToken":{"properties":{"token":{"type":"string","title":"Token"},"created_at":{"type":"integer","title":"Created At","description":"creation unix timestamp"},"name":{"type":"string","title":"Name"},"token_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Id"},"allowed_ips":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Ips"}},"type":"object","required":["token","created_at","name"],"title":"ApiToken"},"ApiTokenIn":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"ApiTokenIn"},"ApiTokenVercelExportIn":{"properties":{"project_id_or_name":{"type":"string","title":"Project Id Or Name"},"is_sensitive":{"type":"boolean","title":"Is Sensitive"},"env_development":{"type":"boolean","title":"Env Development"},"env_preview":{"type":"boolean","title":"Env Preview"},"env_production":{"type":"boolean","title":"Env Production"}},"type":"object","required":["project_id_or_name","is_sensitive","env_development","env_preview","env_production"],"title":"ApiTokenVercelExportIn"},"Body_create_voice_v1_voices_add_post":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["name","description","files"],"title":"Body_create_voice_v1_voices_add_post"},"Body_openai_audio_transcriptions_v1_audio_transcriptions_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"model":{"type":"string","title":"Model"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"response_format":{"anyOf":[{"type":"string","enum":["json","verbose_json","text","srt","vtt"]},{"type":"null"}],"title":"Response Format","default":"json"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":0},"timestamp_granularities":{"anyOf":[{"items":{"type":"string","enum":["segment","word"]},"type":"array"},{"type":"null"}],"title":"Timestamp Granularities"}},"type":"object","required":["file","model"],"title":"Body_openai_audio_transcriptions_v1_audio_transcriptions_post"},"Body_openai_audio_translations_v1_audio_translations_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"model":{"type":"string","title":"Model"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"response_format":{"anyOf":[{"type":"string","enum":["json","verbose_json","text","srt","vtt"]},{"type":"null"}],"title":"Response Format","default":"json"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":0}},"type":"object","required":["file","model"],"title":"Body_openai_audio_translations_v1_audio_translations_post"},"Body_openai_files_v1_files_post":{"properties":{"purpose":{"type":"string","title":"Purpose"},"file":{"items":{"type":"string","format":"binary"},"type":"array","title":"File"}},"type":"object","required":["purpose","file"],"title":"Body_openai_files_v1_files_post"},"Body_openai_images_edits_v1_images_edits_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"inp":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesEditsIn"},{"type":"null"}]},"prompt":{"type":"string","title":"Prompt"},"model":{"type":"string","title":"Model"}},"type":"object","required":["image","prompt","model"],"title":"Body_openai_images_edits_v1_images_edits_post"},"Body_openai_images_variations_v1_images_variations_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"inp":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesVariationsIn"},{"type":"null"}]},"model":{"type":"string","title":"Model"}},"type":"object","required":["image","model"],"title":"Body_openai_images_variations_v1_images_variations_post"},"Body_update_voice_v1_voices__voice_id__edit_post":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","description"],"title":"Body_update_voice_v1_voices__voice_id__edit_post"},"ChatCompletionAssistantMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"assistant","title":"Role","description":"the role of the author of this message","default":"assistant"},"content":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/ChatCompletionContentPartText"},"type":"array"},{"type":"null"}],"title":"Content","description":"the message content"},"reasoning_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Content","description":"the reasoning content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"tool_calls":{"anyOf":[{"items":{"$ref":"#/components/schemas/ChatCompletionMessageToolCall"},"type":"array"},{"type":"null"}],"title":"Tool Calls","description":"the tool calls generated by the mode"}},"type":"object","title":"ChatCompletionAssistantMessage"},"ChatCompletionContentPartAudio":{"properties":{"type":{"type":"string","const":"input_audio","title":"Type"},"input_audio":{"$ref":"#/components/schemas/InputAudio"}},"type":"object","required":["type","input_audio"],"title":"ChatCompletionContentPartAudio"},"ChatCompletionContentPartImage":{"properties":{"type":{"type":"string","const":"image_url","title":"Type"},"image_url":{"$ref":"#/components/schemas/ImageURL"}},"type":"object","required":["type","image_url"],"title":"ChatCompletionContentPartImage"},"ChatCompletionContentPartText":{"properties":{"type":{"type":"string","const":"text","title":"Type"},"text":{"type":"string","title":"Text"}},"type":"object","required":["type","text"],"title":"ChatCompletionContentPartText"},"ChatCompletionContentPartVideo":{"properties":{"type":{"type":"string","const":"video_url","title":"Type"},"video_url":{"$ref":"#/components/schemas/VideoURL"}},"type":"object","required":["type","video_url"],"title":"ChatCompletionContentPartVideo"},"ChatCompletionMessageToolCall":{"properties":{"id":{"type":"string","title":"Id","description":"the id of the tool call"},"type":{"type":"string","title":"Type","description":"the type of the tool call. only function is supported currently"},"function":{"$ref":"#/components/schemas/Function","description":"the function that the model called"}},"type":"object","required":["id","type","function"],"title":"ChatCompletionMessageToolCall"},"ChatCompletionSystemMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"system","title":"Role","description":"the role of the author of this message","default":"system"},"content":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/ChatCompletionContentPartText"},"type":"array"}],"title":"Content","description":"the message content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["content"],"title":"ChatCompletionSystemMessage"},"ChatCompletionToolMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"tool","title":"Role","description":"the role of the author of this message","default":"tool"},"content":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/ChatCompletionContentPartText"},"type":"array"}],"title":"Content","description":"the message content"},"tool_call_id":{"type":"string","title":"Tool Call Id"}},"type":"object","required":["content","tool_call_id"],"title":"ChatCompletionToolMessage"},"ChatCompletionUserMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"user","title":"Role","description":"the role of the author of this message","default":"user"},"content":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletionContentPartText"},{"$ref":"#/components/schemas/ChatCompletionContentPartImage"},{"$ref":"#/components/schemas/ChatCompletionContentPartAudio"},{"$ref":"#/components/schemas/ChatCompletionContentPartVideo"}]},"type":"array"}],"title":"Content","description":"the message content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["content"],"title":"ChatCompletionUserMessage"},"ChatReasoningSettings":{"properties":{"effort":{"anyOf":[{"type":"string","enum":["low","medium","high","xhigh"]},{"type":"null"}],"title":"Effort","description":"Constrains effort on reasoning for reasoning models."},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Enable or disable reasoning with default parameters."}},"type":"object","title":"ChatReasoningSettings"},"ChatTools":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"type":{"type":"string","title":"Type","default":"function"},"function":{"$ref":"#/components/schemas/FunctionDefinition"}},"type":"object","required":["function"],"title":"ChatTools"},"CompletionMultiModalData":{"properties":{"image":{"items":{"type":"string"},"type":"array","title":"Image","description":"List of images as base64 data URIs (e.g. 'data:image/png;base64,...'). Each image must correspond to a placeholder token in the prompt."},"video":{"items":{"type":"string"},"type":"array","title":"Video","description":"List of videos as base64 data URIs (e.g. 'data:video/mp4;base64,...'). Each video must correspond to a placeholder token in the prompt."}},"type":"object","title":"CompletionMultiModalData"},"ContainerRentalOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"state":{"$ref":"#/components/schemas/ContainerRentalStateOut"},"start_ts":{"type":"integer","title":"Start Ts"},"state_ts":{"type":"integer","title":"State Ts"},"stop_ts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stop Ts"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip"},"gpu_config":{"type":"string","title":"Gpu Config"},"price_per_hour":{"type":"number","title":"Price Per Hour"},"container_image":{"type":"string","title":"Container Image"},"fail_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fail Reason"}},"type":"object","required":["id","name","state","start_ts","state_ts","stop_ts","ip","gpu_config","price_per_hour","container_image","fail_reason"],"title":"ContainerRentalOut"},"ContainerRentalStartIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Container Name"},"gpu_config":{"type":"string","minLength":1,"title":"Gpu Config","description":"GPU config"},"container_image":{"type":"string","minLength":1,"title":"Container Image","description":"Container Image"},"cloud_init_user_data":{"type":"string","maxLength":32000,"minLength":1,"title":"Cloud Init User Data","description":"Cloud Init User Data"}},"type":"object","required":["name","gpu_config","container_image","cloud_init_user_data"],"title":"ContainerRentalStartIn"},"ContainerRentalStartOut":{"properties":{"container_id":{"type":"string","title":"Container Id","description":"Container Id"}},"type":"object","required":["container_id"],"title":"ContainerRentalStartOut"},"ContainerRentalStateOut":{"type":"string","enum":["creating","starting","running","shutting_down","failed","deleted"],"title":"ContainerRentalStateOut"},"ContainerRentalUpdateIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Container Name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"ContainerRentalUpdateIn"},"CreateLoraApiRequest":{"properties":{"base_model":{"type":"string","title":"Base Model"},"lora_name":{"type":"string","title":"Lora Name"},"source":{"$ref":"#/components/schemas/SourceModel"},"private":{"type":"boolean","title":"Private"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""}},"type":"object","required":["base_model","lora_name","source","private"],"title":"CreateLoraApiRequest"},"DeepError":{"properties":{"error":{"type":"string","title":"Error","description":"Error","examples":["Model not found"]}},"type":"object","required":["error"],"title":"DeepError"},"DeployDelete":{"properties":{"deploy_id":{"type":"string","title":"Deploy Id","description":"Deploy Id","examples":["fkj843kjh8"]}},"type":"object","required":["deploy_id"],"title":"DeployDelete"},"DeployGPUAvailability":{"properties":{"gpus":{"items":{"$ref":"#/components/schemas/GPUAvailabilityInfo"},"type":"array","title":"Gpus","description":"A list of all provided GPUs configurations, including their price and wether they are available"}},"type":"object","required":["gpus"],"title":"DeployGPUAvailability"},"DeployGPUs":{"type":"string","enum":["L4-24GB","L40S-48GB","A100-80GB","H100-80GB","H200-141GB","B200-180GB","B300-270GB","RTXPRO6000-96GB","other"],"title":"DeployGPUs"},"DeployInstances":{"properties":{"running":{"type":"integer","title":"Running"},"pending":{"type":"integer","title":"Pending"}},"type":"object","required":["running","pending"],"title":"DeployInstances"},"DeployLLMConfig":{"properties":{"gpu":{"$ref":"#/components/schemas/DeployGPUs","description":"The type of GPU the deployment is running on"},"num_gpus":{"type":"integer","title":"Num Gpus","description":"Number of GPUs used by one instance"},"max_batch_size":{"type":"integer","title":"Max Batch Size","description":"Maximum number of concurrent requests"},"weights":{"anyOf":[{"$ref":"#/components/schemas/HFWeights"},{"type":"null"}],"description":"Model weights information"}},"type":"object","required":["gpu","num_gpus","max_batch_size"],"title":"DeployLLMConfig"},"DeployLLMIn":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"model name for deepinfra (username/mode-name format)"},"gpu":{"$ref":"#/components/schemas/DeployGPUs","description":"The type of GPU the deployment is running on"},"num_gpus":{"type":"integer","maximum":8.0,"minimum":1.0,"title":"Num Gpus","description":"Number of GPUs used by one instance","default":1},"max_batch_size":{"type":"integer","maximum":256.0,"minimum":1.0,"title":"Max Batch Size","description":"Maximum number of concurrent requests","default":96},"hf":{"anyOf":[{"$ref":"#/components/schemas/HFWeights"},{"type":"null"}]},"base_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model","description":"Base public model"},"container_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Container Image","description":"Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4)"},"settings":{"anyOf":[{"$ref":"#/components/schemas/ScaleSettings"},{"type":"null"}]},"extra_args":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Args","description":"Extra command line arguments for custom deployments"}},"type":"object","required":["model_name","gpu"],"title":"DeployLLMIn"},"DeployLLMUpdateIn":{"properties":{"settings":{"$ref":"#/components/schemas/ScaleSettings"}},"type":"object","required":["settings"],"title":"DeployLLMUpdateIn"},"DeployModelIn":{"properties":{"provider":{"$ref":"#/components/schemas/ModelProvider","description":"namespace for the model name","default":"cnt"},"model_name":{"type":"string","title":"Model Name","description":"model name in specified provider"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version","description":"A specific revision, if left empty uses the last one"}},"type":"object","required":["model_name"],"title":"DeployModelIn"},"DeployResult":{"properties":{"deploy_id":{"type":"string","title":"Deploy Id","description":"Deploy Id","examples":["fkj843kjh8"]}},"type":"object","required":["deploy_id"],"title":"DeployResult"},"DeployStatusOut":{"properties":{"deploy_id":{"type":"string","title":"Deploy Id","description":"Deploy Id","examples":["fkj843kjh8"]}},"type":"object","required":["deploy_id"],"title":"DeployStatusOut"},"DeployType":{"type":"string","enum":["legacy","llm","lora","tts"],"title":"DeployType"},"DeploymentLogEntry":{"prefixItems":[{"type":"string","title":"Ts","description":"timestamp in fractional seconds since unix epoch (ns precision)"},{"type":"string","title":"Line","description":"a single log line"}],"type":"array","maxItems":2,"minItems":2},"DeploymentLogQueryOut":{"properties":{"entries":{"additionalProperties":{"items":{"$ref":"#/components/schemas/DeploymentLogEntry"},"type":"array"},"type":"object","title":"Entries","description":"mapping of pod names to log lines ordered by increasing timestamp"}},"type":"object","title":"DeploymentLogQueryOut"},"DeploymentMainStatsOut":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Model name","examples":["google/vit-base-patch16-224"]},"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"}},"type":"object","required":["model_name","requests"],"title":"DeploymentMainStatsOut"},"DeploymentOut":{"properties":{"type":{"$ref":"#/components/schemas/DeployType","default":"legacy"},"deploy_id":{"type":"string","title":"Deploy Id","description":"Deploy Id","examples":["fkj843kjh8"]},"model_name":{"type":"string","title":"Model Name","description":"Model Id from huggingface","examples":["google/vit-base-patch16-224"]},"version":{"type":"string","title":"Version","description":"Model version","examples":["d8b79b422843bd59d628bf25b01aded94a9ec1a9b917e69fe460df9ff39ec42b"]},"task":{"type":"string","title":"Task","description":"Task","examples":["image-classification"]},"status":{"type":"string","title":"Status","description":"Status","examples":["deployed"]},"fail_reason":{"type":"string","title":"Fail Reason","description":"Failure reason","examples":["Initialization failed"]},"created_at":{"type":"string","title":"Created At","description":"Created at","examples":["2021-08-27T17:19:21+00:00"]},"updated_at":{"type":"string","title":"Updated At","description":"Updated at","examples":["2021-08-27T17:19:21+00:00"]},"instances":{"anyOf":[{"$ref":"#/components/schemas/DeployInstances"},{"type":"null"}],"description":"Details about number of instances running right now"},"config":{"anyOf":[{"$ref":"#/components/schemas/DeployLLMConfig"},{"type":"null"}],"description":"Immutable deploy configuration"},"settings":{"anyOf":[{"$ref":"#/components/schemas/ScaleSettings"},{"type":"null"}],"description":"Scale Settings"}},"type":"object","required":["deploy_id","model_name","version","task","status","fail_reason","created_at","updated_at"],"title":"DeploymentOut"},"DeploymentStatsOut":{"properties":{"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"},"total_time":{"type":"integer","title":"Total Time","description":"total number of seconds spend in inference"},"total_tokens":{"type":"integer","title":"Total Tokens","description":"total number of tokens generated"},"input_tokens":{"type":"integer","title":"Input Tokens","description":"number of input tokens generated"},"output_tokens":{"type":"integer","title":"Output Tokens","description":"number of output tokens generated"},"total_amount":{"type":"integer","title":"Total Amount","description":"total number of cents spent"},"avg_time":{"type":"number","title":"Avg Time","description":"average millisecond inference time"},"avg95_time":{"type":"number","title":"Avg95 Time","description":"95th percentile inference time (estimated)"},"errors":{"type":"integer","title":"Errors","description":"number of errors"}},"type":"object","required":["requests","total_time","total_tokens","input_tokens","output_tokens","total_amount","avg_time","avg95_time","errors"],"title":"DeploymentStatsOut"},"DetailedDeploymentStatsOut":{"properties":{"llm":{"anyOf":[{"$ref":"#/components/schemas/LLMDeploymentStatsOut"},{"type":"null"}],"description":"LLM Deployment Stats"},"embeddings":{"anyOf":[{"$ref":"#/components/schemas/EmbeddingsDeploymentStatsOut"},{"type":"null"}],"description":"Embeddings Deployment Stats"},"time":{"anyOf":[{"$ref":"#/components/schemas/TimeDeploymentStatsOut"},{"type":"null"}],"description":"Time based Deployment Stats"}},"type":"object","title":"DetailedDeploymentStatsOut"},"DisplayNameIn":{"properties":{"display_name":{"type":"string","maxLength":39,"minLength":1,"pattern":"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$","title":"Display Name","description":"String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes."}},"type":"object","required":["display_name"],"title":"DisplayNameIn"},"ElevenLabsTextToSpeechIn":{"properties":{"text":{"type":"string","title":"Text","description":"Text to convert to speech","examples":["I'm beginnin' to feel like a Rap God, Rap God\nAll my people from the front to the back nod, back nod\nNow, who thinks their arms are long enough to slap box, slap box?\nThey said I rap like a robot, so call me Rap-bot"]},"model_id":{"type":"string","title":"Model Id","description":"Model ID to use for the conversion","default":"hexgrad/Kokoro-82M"},"output_format":{"$ref":"#/components/schemas/TtsResponseFormat","description":"Output format for the speech"},"language_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Code","description":"ISO 639-1, 2 letter language code"}},"type":"object","required":["text"],"title":"ElevenLabsTextToSpeechIn"},"EmailsOut":{"properties":{"emails":{"items":{"type":"string"},"type":"array","title":"Emails","description":"List of emails verified by theauthenticaiton provider"}},"type":"object","required":["emails"],"title":"EmailsOut"},"EmbeddingsDeploymentStatsOut":{"properties":{"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"},"input_tokens":{"type":"integer","title":"Input Tokens","description":"number of input tokens generated"},"avg_tpt_ms":{"type":"number","title":"Avg Tpt Ms","description":"average millisecond time per token"},"avg95_tpt_ms":{"type":"number","title":"Avg95 Tpt Ms","description":"95th percentile time per token (estimated)"},"total_amount_cents":{"type":"integer","title":"Total Amount Cents","description":"total number of cents spent"},"errors":{"type":"integer","title":"Errors","description":"number of errors"}},"type":"object","required":["requests","input_tokens","avg_tpt_ms","avg95_tpt_ms","total_amount_cents","errors"],"title":"EmbeddingsDeploymentStatsOut"},"FAQEntryOut":{"properties":{"faq_id":{"type":"string","title":"Faq Id","description":"FAQ entry ID, usually the question"},"question":{"type":"string","title":"Question","description":"FAQ question"},"answer":{"type":"string","title":"Answer","description":"FAQ answer in markdown format"},"order":{"type":"integer","title":"Order","description":"order of the FAQ entry in the list, lower numbers come first","default":0}},"type":"object","required":["faq_id","question","answer"],"title":"FAQEntryOut"},"FeedbackIn":{"properties":{"message":{"type":"string","title":"Message","description":"The message you'd like to send to deepinfra team"},"contact_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Contact Email","description":"Optional contact email to reach you back"}},"type":"object","required":["message"],"title":"FeedbackIn"},"Function":{"properties":{"name":{"type":"string","title":"Name","description":"the name of the function to call"},"arguments":{"type":"string","title":"Arguments","description":"the function arguments, generated by the model in JSON format. the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema"}},"type":"object","required":["name","arguments"],"title":"Function"},"FunctionDefinition":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parameters"}},"type":"object","required":["name"],"title":"FunctionDefinition"},"GPUAvailabilityInfo":{"properties":{"gpu_config":{"type":"string","title":"Gpu Config"},"usd_per_hour":{"type":"number","title":"Usd Per Hour"},"available":{"type":"boolean","title":"Available"},"recommended":{"type":"boolean","title":"Recommended","default":false}},"type":"object","required":["gpu_config","usd_per_hour","available"],"title":"GPUAvailabilityInfo"},"GetVoicesOut":{"properties":{"voices":{"items":{"$ref":"#/components/schemas/Voice"},"type":"array","title":"Voices"}},"type":"object","title":"GetVoicesOut"},"GpuLimitOut":{"properties":{"limits":{"additionalProperties":{"type":"integer"},"type":"object","title":"Limits","description":"Effective GPU limits per type (defaults merged with overrides)"},"pending_requests":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Pending Requests","description":"Pending GPU limit increase requests per type"}},"type":"object","required":["limits"],"title":"GpuLimitOut"},"GpuLimitRequestIn":{"properties":{"gpu_type":{"type":"string","title":"Gpu Type"},"requested_limit":{"type":"integer","title":"Requested Limit"},"reason":{"type":"string","maxLength":2048,"title":"Reason"}},"type":"object","required":["gpu_type","requested_limit","reason"],"title":"GpuLimitRequestIn"},"HFModel":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Model Id from huggingface","examples":["google/vit-base-patch16-224"]},"task":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task","description":"Task","examples":["image-classification"]}},"type":"object","required":["model_name"],"title":"HFModel"},"HFTasksE":{"type":"string","enum":["automatic-speech-recognition","image-classification","question-answering","token-classification","text-to-image","fill-mask","zero-shot-image-classification","text2text-generation","text-generation","text-classification","object-detection","embeddings","dreambooth","custom","text-to-speech","text-to-video","rent-container","reranker","openclaw","hermes","world-model"],"title":"HFTasksE"},"HFWeights":{"properties":{"repo":{"type":"string","title":"Repo","description":"huggingface repository i.e username/reponame"},"revision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision","description":"commit sha or branch name"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token","description":"huggingface access token with read access to the repo"}},"type":"object","required":["repo"],"title":"HFWeights"},"HardwareOption":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["serverless","dedicated"],"title":"Type"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/HardwarePricingServerless"},{"$ref":"#/components/schemas/HardwarePricingDedicated"}],"title":"Pricing"}},"type":"object","required":["id","name","type","pricing"],"title":"HardwareOption"},"HardwarePricingDedicated":{"properties":{"cents_per_minute":{"type":"number","title":"Cents Per Minute"}},"type":"object","required":["cents_per_minute"],"title":"HardwarePricingDedicated"},"HardwarePricingServerless":{"properties":{"cents_per_million_input_tokens":{"type":"number","title":"Cents Per Million Input Tokens"},"cents_per_million_output_tokens":{"type":"number","title":"Cents Per Million Output Tokens"}},"type":"object","required":["cents_per_million_input_tokens","cents_per_million_output_tokens"],"title":"HardwarePricingServerless"},"HardwareResponse":{"properties":{"hardware":{"items":{"$ref":"#/components/schemas/HardwareOption"},"type":"array","title":"Hardware"}},"type":"object","title":"HardwareResponse"},"ImageURL":{"properties":{"url":{"type":"string","title":"Url"},"detail":{"type":"string","enum":["auto","low","high"],"title":"Detail","default":"auto"}},"type":"object","required":["url"],"title":"ImageURL"},"InputAudio":{"properties":{"data":{"type":"string","title":"Data"},"format":{"type":"string","enum":["wav","mp3"],"title":"Format","default":"wav"}},"type":"object","required":["data"],"title":"InputAudio"},"InspectScopedJWTOut":{"properties":{"expires_at":{"type":"integer","title":"Expires At","description":"unix timestamp of when the token expires"},"models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Models","description":"which models is the token limited to"},"spending_limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spending Limit","description":"how much is the total spending limit set at creation"}},"type":"object","required":["expires_at"],"title":"InspectScopedJWTOut"},"JsonObjectResponseFormat":{"properties":{"type":{"type":"string","const":"json_object","title":"Type","default":"json_object"}},"type":"object","title":"JsonObjectResponseFormat"},"JsonSchema":{"properties":{"name":{"type":"string","title":"Name","description":"Name identifier for the JSON schema"},"schema":{"additionalProperties":true,"type":"object","title":"Schema","description":"The actual JSON schema definition"}},"type":"object","required":["name","schema"],"title":"JsonSchema"},"JsonSchemaResponseFormat":{"properties":{"type":{"type":"string","const":"json_schema","title":"Type","default":"json_schema"},"json_schema":{"$ref":"#/components/schemas/JsonSchema","description":"JSON schema for structured output when type is 'json_schema'"}},"type":"object","required":["json_schema"],"title":"JsonSchemaResponseFormat"},"LLMDeploymentStatsOut":{"properties":{"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"},"input_tokens":{"type":"integer","title":"Input Tokens","description":"number of input tokens generated"},"output_tokens":{"type":"integer","title":"Output Tokens","description":"number of output tokens generated"},"avg_ttft_ms":{"type":"number","title":"Avg Ttft Ms","description":"average millisecond time to first token"},"avg95_ttft_ms":{"type":"number","title":"Avg95 Ttft Ms","description":"95th percentile time to first token (estimated)"},"avg_tpt_ms":{"type":"number","title":"Avg Tpt Ms","description":"average millisecond time per token"},"avg95_tpt_ms":{"type":"number","title":"Avg95 Tpt Ms","description":"95th percentile time per token (estimated)"},"total_amount_cents":{"type":"integer","title":"Total Amount Cents","description":"total number of cents spent"},"errors":{"type":"integer","title":"Errors","description":"number of errors"}},"type":"object","required":["requests","input_tokens","output_tokens","avg_ttft_ms","avg95_ttft_ms","avg_tpt_ms","avg95_tpt_ms","total_amount_cents","errors"],"title":"LLMDeploymentStatsOut"},"LogEntry":{"prefixItems":[{"type":"string","title":"Ts","description":"timestamp in fractional seconds since unix epoch (ns precision)"},{"type":"string","title":"Line","description":"a single log line"}],"type":"array","maxItems":2,"minItems":2},"LogQueryOut":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/LogEntry"},"type":"array","title":"Entries","description":"list of log lines ordered by increasing timestamp"}},"type":"object","title":"LogQueryOut"},"LoraModelUploadIn":{"properties":{"hf_model_name":{"type":"string","title":"Hf Model Name"},"hf_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hf Token"},"lora_model_name":{"type":"string","title":"Lora Model Name"},"base_model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model Name"}},"type":"object","required":["hf_model_name","lora_model_name"],"title":"LoraModelUploadIn"},"Me":{"properties":{"uid":{"type":"string","title":"Uid"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"email_verified":{"type":"boolean","title":"Email Verified"},"account_setup":{"type":"boolean","title":"Account Setup"},"require_email_verified":{"type":"boolean","title":"Require Email Verified","default":false},"display_name":{"type":"string","title":"Display Name","description":"Name that is used to identifythe account on the website"},"provider":{"type":"string","title":"Provider","description":"Authentication provider, e.g. 'github'"},"picture":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Picture"},"is_admin":{"type":"boolean","title":"Is Admin"},"can_access_agents":{"type":"boolean","title":"Can Access Agents","description":"Whether the user may use the hosted-agents feature (admins, plus the AGENTS_ACCESS_UIDS allowlist)","default":false},"name":{"type":"string","title":"Name","description":"Personal name"},"first_name":{"type":"string","title":"First Name","description":"First name of the user"},"last_name":{"type":"string","title":"Last Name","description":"Last name of the user"},"country":{"type":"string","title":"Country","description":"Country of the user"},"is_business_account":{"type":"boolean","title":"Is Business Account"},"company":{"type":"string","title":"Company","description":"Company name"},"website":{"type":"string","title":"Website","description":"Company website address"},"title":{"type":"string","title":"Title","description":"Job title of the user, e.g. 'Software Engineer'"},"is_team_account":{"type":"boolean","title":"Is Team Account","default":false},"is_team_owner":{"type":"boolean","title":"Is Team Owner","default":false},"team_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Role"},"team_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Display Name"},"is_team_upgrade_enabled":{"type":"boolean","title":"Is Team Upgrade Enabled","default":true},"vercel_connection":{"anyOf":[{"$ref":"#/components/schemas/MeVercelConnection"},{"type":"null"}]},"checklist":{"anyOf":[{"$ref":"#/components/schemas/Checklist"},{"type":"null"}]}},"type":"object","required":["uid","email","email_verified","account_setup","display_name","provider","picture","is_admin","name","first_name","last_name","country","is_business_account","company","website","title"],"title":"Me"},"MeIn":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":256,"minLength":1},{"type":"null"}],"title":"Name","description":"Personal name"},"first_name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"First Name","description":"First name of the user"},"last_name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Last Name","description":"Last name of the user"},"country":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Country","description":"Country of the user"},"email":{"anyOf":[{"type":"string","maxLength":320,"minLength":1},{"type":"null"}],"title":"Email"},"is_business_account":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Business Account"},"company":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Company","description":"Company name"},"website":{"anyOf":[{"type":"string","maxLength":128,"minLength":0},{"type":"null"}],"title":"Website","description":"Company website address"},"title":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Title","description":"Job title of the user, e.g. 'Software Engineer'"},"display_name":{"anyOf":[{"type":"string","maxLength":39,"minLength":1,"pattern":"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"},{"type":"null"}],"title":"Display Name","description":"String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes."},"use_case":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Use Case","description":"Short description of the use case for the account"},"attribution":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Attribution","description":"Short description of how the user found out about DeepInfra"},"marketing_emails":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Marketing Emails","description":"Set to false to opt out of marketing emails"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code","description":"ISO 3166-1 alpha-2 country code of the user selected country"}},"type":"object","title":"MeIn"},"MeVercelConnection":{"properties":{"user_id":{"type":"string","title":"User Id"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"installation_id":{"type":"string","title":"Installation Id"}},"type":"object","required":["user_id","installation_id"],"title":"MeVercelConnection"},"ModelDocBlock":{"properties":{"key":{"$ref":"#/components/schemas/ModelDocBlockKey"},"url":{"type":"string","title":"Url"}},"type":"object","required":["key","url"],"title":"ModelDocBlock"},"ModelDocBlockKey":{"type":"string","enum":["http","http-bge-m3-multimodal","http-bagel-multimodal","deepctl","js-text-gen","js-emb","js-text-to-img","js-speech-to-text","openai-python","openai-python-short","openai-http","openai-js","openai-js-short","openai-speech-http","openai-speech-python","openai-speech-js","openai-images-http","openai-images-python","openai-images-js","openai-images-variations-http","openai-images-variations-python","openai-images-variations-js","openai-images-edits-http","openai-images-edits-python","openai-images-edits-js","openai-comp-python","openai-comp-python-short","openai-comp-http","openai-comp-js","openai-comp-js-short","openai-emb-py","openai-emb-http","openai-emb-js","openai-tts-http","openai-tts-python","openai-tts-js","elevenlabs-tts-http","elevenlabs-tts-python","elevenlabs-tts-js","create-voice-http","create-voice-python","create-voice-js","read-voice-http","read-voice-python","read-voice-js","update-voice-http","update-voice-python","update-voice-js","delete-voice-http","delete-voice-python","delete-voice-js","list-voices-http","list-voices-python","list-voices-js","ai-sdk-js","ai-sdk-js-short"],"title":"ModelDocBlockKey"},"ModelFamilyOut":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Model family name"},"title":{"type":"string","title":"Title","description":"Model family title"},"description":{"type":"string","title":"Description","description":"Model family description"},"developer":{"type":"string","title":"Developer","description":"Model family developer organization"},"meta_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Title","description":"Meta title for SEO"},"meta_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Description","description":"Meta description for SEO"},"featured_models":{"items":{"type":"string"},"type":"array","title":"Featured Models"},"pp_sections_out":{"items":{"$ref":"#/components/schemas/PricingPageSectionOut"},"type":"array","title":"Pp Sections Out"},"faq_entries":{"items":{"$ref":"#/components/schemas/FAQEntryOut"},"type":"array","title":"Faq Entries","description":"List of FAQ entries for this model family, ordered by their order field"}},"type":"object","required":["name","title","description","developer","featured_models","pp_sections_out"],"title":"ModelFamilyOut"},"ModelFieldInfo":{"properties":{"name":{"type":"string","title":"Name"},"parent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent"},"ftype":{"type":"string","title":"Ftype"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"allowed":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Allowed"},"default":{"title":"Default"},"examples":{"items":{},"type":"array","title":"Examples","default":[]},"minimum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Minimum"},"exclusiveMinimum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exclusiveminimum"},"maximum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Maximum"},"exclusiveMaximum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exclusivemaximum"}},"type":"object","required":["name","ftype"],"title":"ModelFieldInfo"},"ModelInfoOut":{"properties":{"model_name":{"type":"string","title":"Model Name"},"type":{"type":"string","title":"Type"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"reported_type":{"type":"string","title":"Reported Type"},"version":{"type":"string","title":"Version"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"mf_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mf Description"},"featured":{"type":"boolean","title":"Featured"},"owner":{"type":"boolean","title":"Owner","default":false},"public":{"type":"boolean","title":"Public"},"curl_inv":{"type":"string","title":"Curl Inv"},"cmdline_inv":{"type":"string","title":"Cmdline Inv"},"txt_docs":{"type":"string","title":"Txt Docs"},"out_example":{"type":"string","title":"Out Example"},"out_docs":{"type":"string","title":"Out Docs"},"in_schema":{"title":"In Schema"},"out_schema":{"title":"Out Schema"},"in_fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/ModelFieldInfo"},"type":"array"},{"type":"null"}],"title":"In Fields"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/ModelPricingTime"},{"$ref":"#/components/schemas/ModelPricingUptime"},{"$ref":"#/components/schemas/ModelPricingTokens"},{"$ref":"#/components/schemas/ModelPricingInputLength"},{"$ref":"#/components/schemas/ModelPricingInputTokens"},{"$ref":"#/components/schemas/ModelPricingInputCharacterLength"},{"$ref":"#/components/schemas/ModelPricingImageUnits"},{"$ref":"#/components/schemas/ModelPricingOutputLength"},{"$ref":"#/components/schemas/ModelPricingFrameUnits"}],"title":"Pricing"},"doc_blocks":{"anyOf":[{"items":{"$ref":"#/components/schemas/ModelDocBlock"},"type":"array"},{"type":"null"}],"title":"Doc Blocks"},"short_doc_block":{"anyOf":[{"$ref":"#/components/schemas/ModelDocBlock"},{"type":"null"}]},"schemas":{"items":{"$ref":"#/components/schemas/SchemaVariant"},"type":"array","title":"Schemas"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","default":{}},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"max_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Output Tokens"},"replaced_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replaced By"},"deprecated":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deprecated"},"quantization":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantization"},"mmlu":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mmlu"},"expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected"},"import_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Import Time"},"is_partner":{"type":"boolean","title":"Is Partner","default":false},"is_custom_deployable":{"type":"boolean","title":"Is Custom Deployable","default":false},"mf_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mf Name"},"mf_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mf Title"}},"type":"object","required":["model_name","type","tags","reported_type","version","featured","public","curl_inv","cmdline_inv","txt_docs","out_example","out_docs","pricing","schemas"],"title":"ModelInfoOut"},"ModelMetaIn":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"short model description in plain text"},"github_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Github Url","description":"source code project link (empty to delete)"},"paper_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paper Url","description":"paper/research link (empty to delete)"},"license_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Url","description":"usage license link (empty to delete)"},"readme":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Readme","description":"markdown flavored model readme"},"cover_img_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cover Img Url","description":"dataurl or regular url to cover image (empty to delete)"},"reported_type":{"anyOf":[{"$ref":"#/components/schemas/HFTasksE"},{"type":"null"}],"description":"model type"}},"additionalProperties":false,"type":"object","title":"ModelMetaIn"},"ModelMetadata":{"properties":{"description":{"type":"string","title":"Description"},"context_length":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Length"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"pricing":{"additionalProperties":{"type":"number"},"type":"object","title":"Pricing"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"default_width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Width"},"default_height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Height"},"default_iterations":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Iterations"}},"type":"object","required":["description","pricing","tags"],"title":"ModelMetadata","description":"Per-model metadata exposed by ``/v1/openai/models``.\n\nPricing key names are surface-specific:\n\n- chat / vlm: {\"input_tokens\", \"output_tokens\", \"cache_read_tokens\"} ($/1M tokens)\n- embed: {\"input_tokens\"} ($/1M tokens)\n- image-gen: {\"per_image_unit\"} ($/image at default geometry)\n- video-gen: {\"output_seconds\"} ($/sec generated)\n- tts: {\"input_characters\"} ($/1M input chars)\n- stt: {\"input_seconds\"} ($/sec input audio)\n\n``tags`` always carries the surface short alias (e.g. ``'chat'``,\n``'image-gen'``) and, for chat models, any of ``'vision'``,\n``'prompt_cache'``, ``'reasoning_effort'``, ``'reasoning'``."},"ModelNameSuggestionOut":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"A model name that is currently free to claim (prefixed in username/model-name format)."}},"type":"object","required":["model_name"],"title":"ModelNameSuggestionOut"},"ModelOut":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Model Name","examples":["microsoft/resnet-50"]},"type":{"type":"string","title":"Type","description":"raw type of the model","examples":["image-classification"]},"reported_type":{"type":"string","title":"Reported Type","description":"reported type of the model","examples":["text-generation"]},"description":{"type":"string","title":"Description","description":"description of the model","default":"","examples":["ResNet-50 is a convolutional neural network that is trained on more than a million images from the ImageNet database. It is a 50-layer deep neural network."]},"cover_img_url":{"type":"string","title":"Cover Img Url","description":"cover image link","default":""},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"list of tags"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/ModelPricingTime"},{"$ref":"#/components/schemas/ModelPricingTokens"},{"$ref":"#/components/schemas/ModelPricingInputLength"},{"$ref":"#/components/schemas/ModelPricingInputTokens"},{"$ref":"#/components/schemas/ModelPricingUptime"},{"$ref":"#/components/schemas/ModelPricingInputCharacterLength"},{"$ref":"#/components/schemas/ModelPricingImageUnits"},{"$ref":"#/components/schemas/ModelPricingOutputLength"},{"$ref":"#/components/schemas/ModelPricingFrameUnits"}],"title":"Pricing","description":"The pricing type and cost for this model"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens","description":"The maximum context size of this model, if applicable"},"replaced_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replaced By"},"deprecated":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deprecated"},"quantization":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantization"},"mmlu":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mmlu"},"expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected"},"create_ts":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Create Ts"},"private":{"type":"integer","title":"Private","default":0},"is_partner":{"type":"boolean","title":"Is Partner","default":false}},"type":"object","required":["model_name","type","reported_type","pricing"],"title":"ModelOut"},"ModelPricingFrameUnits":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"frame_units"},"cents_per_frame_unit":{"type":"number","title":"Cents Per Frame Unit"}},"type":"object","required":["cents_per_frame_unit"],"title":"ModelPricingFrameUnits"},"ModelPricingImageUnits":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"image_units"},"cents_per_image_unit":{"type":"number","title":"Cents Per Image Unit"},"default_width":{"type":"integer","title":"Default Width"},"default_height":{"type":"integer","title":"Default Height"},"default_iterations":{"type":"integer","title":"Default Iterations"},"default_price_cents":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Default Price Cents"},"usage_from_cost":{"type":"boolean","title":"Usage From Cost"}},"type":"object","required":["cents_per_image_unit","default_width","default_height","default_iterations","usage_from_cost"],"title":"ModelPricingImageUnits"},"ModelPricingInputCharacterLength":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"input_character_length"},"cents_per_input_chars":{"type":"number","title":"Cents Per Input Chars"}},"type":"object","required":["cents_per_input_chars"],"title":"ModelPricingInputCharacterLength"},"ModelPricingInputLength":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"input_length"},"cents_per_input_sec":{"type":"number","title":"Cents Per Input Sec"}},"type":"object","required":["cents_per_input_sec"],"title":"ModelPricingInputLength"},"ModelPricingInputTokens":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"input_tokens"},"cents_per_input_token":{"type":"number","title":"Cents Per Input Token"}},"type":"object","required":["cents_per_input_token"],"title":"ModelPricingInputTokens"},"ModelPricingOutputLength":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"output_length"},"cents_per_output_sec":{"type":"number","title":"Cents Per Output Sec"}},"type":"object","required":["cents_per_output_sec"],"title":"ModelPricingOutputLength"},"ModelPricingTime":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"time"},"cents_per_sec":{"type":"number","title":"Cents Per Sec"}},"type":"object","required":["cents_per_sec"],"title":"ModelPricingTime"},"ModelPricingTokens":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"tokens"},"cents_per_input_token":{"type":"number","title":"Cents Per Input Token"},"cents_per_output_token":{"type":"number","title":"Cents Per Output Token"},"rate_per_input_token_cached":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate Per Input Token Cached"},"rate_per_input_token_cache_write":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate Per Input Token Cache Write"}},"type":"object","required":["cents_per_input_token","cents_per_output_token"],"title":"ModelPricingTokens"},"ModelPricingUptime":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"uptime"},"cents_per_sec":{"type":"number","title":"Cents Per Sec"}},"type":"object","required":["cents_per_sec"],"title":"ModelPricingUptime"},"ModelProvider":{"type":"string","enum":["huggingface","deepinfra","cnt"],"title":"ModelProvider"},"ModelPublicityIn":{"properties":{"public":{"type":"boolean","title":"Public","description":"whether to make the model public of private"}},"type":"object","required":["public"],"title":"ModelPublicityIn"},"ModelVersionOut":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Model Name","examples":["microsoft/resnet-50"]},"version":{"type":"string","title":"Version","description":"Version identifier","examples":["06dbf5f73be4b5eca79e137e00c4825f467cd5b172c64b6c9255dc4b5a25a03a"]},"uploaded_at":{"type":"string","title":"Uploaded At","description":"Upload time","examples":["2023-01-19T21:52:03.626241+00:00"]}},"type":"object","required":["model_name","version","uploaded_at"],"title":"ModelVersionOut"},"OpenAIBatch":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object"},"endpoint":{"type":"string","title":"Endpoint"},"errors":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Errors"},"input_file_id":{"type":"string","title":"Input File Id"},"completion_window":{"type":"string","title":"Completion Window"},"status":{"type":"string","title":"Status"},"output_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output File Id"},"error_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error File Id"},"created_at":{"type":"integer","title":"Created At"},"in_progress_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"In Progress At"},"completed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completed At"},"failed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed At"},"finalizing_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Finalizing At"},"expires_at":{"type":"integer","title":"Expires At"},"expired_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expired At"},"cancelled_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancelled At"},"cancelling_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancelling At"},"request_counts":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Request Counts"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["id","object","endpoint","input_file_id","completion_window","status","created_at","expires_at"],"title":"OpenAIBatch"},"OpenAIBatchesIn":{"properties":{"input_file_id":{"type":"string","title":"Input File Id","description":"The ID of an uploaded file that contains requests for the new batch."},"endpoint":{"type":"string","enum":["/v1/chat/completions","/v1/completions"],"title":"Endpoint","description":"The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported."},"completion_window":{"type":"string","const":"24h","title":"Completion Window","description":"The time frame within which the batch should be processed. Currently only 24h is supported."},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Optional metadata to be stored with the batch."}},"type":"object","required":["input_file_id","endpoint","completion_window","metadata"],"title":"OpenAIBatchesIn"},"OpenAIChatCompletionsIn":{"properties":{"model":{"type":"string","title":"Model","description":"model name","examples":["meta-llama/Llama-2-70b-chat-hf"]},"messages":{"items":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletionToolMessage"},{"$ref":"#/components/schemas/ChatCompletionAssistantMessage"},{"$ref":"#/components/schemas/ChatCompletionUserMessage"},{"$ref":"#/components/schemas/ChatCompletionSystemMessage"}]},"type":"array","title":"Messages","description":"conversation messages: (user,assistant,tool)*,user including one system message anywhere"},"stream":{"type":"boolean","title":"Stream","description":"whether to stream the output via SSE or return the full response","default":false},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic","default":1.0},"top_p":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Top P","description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.","default":1.0},"min_p":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min P","description":"Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.","default":0.0},"top_k":{"type":"integer","exclusiveMaximum":1000.0,"minimum":0.0,"title":"Top K","description":"Sample from the best k (number of) tokens. 0 means off","default":0},"max_tokens":{"anyOf":[{"type":"integer","maximum":10000000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Tokens","description":"The maximum number of tokens to generate in the chat completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller."},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop","description":"up to 16 sequences where the API will stop generating further tokens"},"stop_token_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Stop Token Ids","description":"Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments."},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"number of sequences to return","default":1},"presence_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Presence Penalty","description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"frequency_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Frequency Penalty","description":"Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/ChatTools"},"type":"array"},{"type":"null"}],"title":"Tools","description":"A list of tools the model may call. Currently, only functions are supported as a tool."},"tool_choice":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/ChatTools"},{"type":"null"}],"title":"Tool Choice","description":"Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present."},"response_format":{"anyOf":[{"$ref":"#/components/schemas/TextResponseFormat"},{"$ref":"#/components/schemas/JsonObjectResponseFormat"},{"$ref":"#/components/schemas/JsonSchemaResponseFormat"},{"$ref":"#/components/schemas/RegexResponseFormat"},{"type":"null"}],"title":"Response Format","description":"The format of the response. Currently, only json is supported."},"repetition_penalty":{"type":"number","maximum":5.0,"minimum":0.01,"title":"Repetition Penalty","description":"Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)","default":1},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers."},"seed":{"anyOf":[{"type":"integer","exclusiveMaximum":1.8446744073709552e+19,"minimum":-9.223372036854776e+18},{"type":"null"}],"title":"Seed","description":"Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed."},"logprobs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Logprobs","description":"Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`."},"stream_options":{"anyOf":[{"$ref":"#/components/schemas/StreamOptions"},{"type":"null"}],"description":"streaming options"},"reasoning_effort":{"anyOf":[{"type":"string","enum":["low","medium","high","xhigh","none"]},{"type":"null"}],"title":"Reasoning Effort","description":"Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports."},"reasoning":{"anyOf":[{"$ref":"#/components/schemas/ChatReasoningSettings"},{"type":"null"}],"description":"Reasoning configuration."},"prompt_cache_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Cache Key","description":"A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key."},"chat_template_kwargs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Chat Template Kwargs","description":"Chat template kwargs."},"continue_final_message":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Continue Final Message","description":"If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message."}},"type":"object","required":["model","messages"],"title":"OpenAIChatCompletionsIn"},"OpenAICompletionsIn":{"properties":{"model":{"type":"string","title":"Model","description":"model name","examples":["meta-llama/Llama-2-70b-chat-hf"]},"prompt":{"anyOf":[{"type":"string"},{"items":{"type":"integer"},"type":"array"}],"title":"Prompt","description":"input prompt - a single string is currently supported"},"max_tokens":{"anyOf":[{"type":"integer","maximum":10000000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Tokens","description":"The maximum number of tokens to generate in the completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller."},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic","default":1.0},"top_p":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Top P","description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.","default":1.0},"min_p":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min P","description":"Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.","default":0.0},"top_k":{"type":"integer","exclusiveMaximum":1000.0,"minimum":0.0,"title":"Top K","description":"Sample from the best k (number of) tokens. 0 means off","default":0},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"number of sequences to return","default":1},"stream":{"type":"boolean","title":"Stream","description":"whether to stream the output via SSE or return the full response","default":false},"logprobs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Logprobs","description":"return top tokens and their log-probabilities"},"echo":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Echo","description":"return prompt as part of the respons"},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop","description":"up to 16 sequences where the API will stop generating further tokens"},"presence_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Presence Penalty","description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"frequency_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Frequency Penalty","description":"Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"response_format":{"anyOf":[{"$ref":"#/components/schemas/TextResponseFormat"},{"$ref":"#/components/schemas/JsonObjectResponseFormat"},{"$ref":"#/components/schemas/JsonSchemaResponseFormat"},{"$ref":"#/components/schemas/RegexResponseFormat"},{"type":"null"}],"title":"Response Format","description":"The format of the response. Currently, only json is supported."},"repetition_penalty":{"type":"number","maximum":5.0,"minimum":0.01,"title":"Repetition Penalty","description":"Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)","default":1},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers."},"seed":{"anyOf":[{"type":"integer","exclusiveMaximum":1.8446744073709552e+19,"minimum":-9.223372036854776e+18},{"type":"null"}],"title":"Seed","description":"Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed."},"stream_options":{"anyOf":[{"$ref":"#/components/schemas/StreamOptions"},{"type":"null"}],"description":"streaming options"},"stop_token_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Stop Token Ids","description":"Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments."},"return_tokens_as_token_ids":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Return Tokens As Token Ids","description":"return tokens as token ids"},"prompt_cache_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Cache Key","description":"A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key."},"data":{"anyOf":[{"$ref":"#/components/schemas/CompletionMultiModalData"},{"type":"null"}],"description":"Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...')."}},"type":"object","required":["model","prompt"],"title":"OpenAICompletionsIn"},"OpenAIEmbeddingsIn":{"properties":{"service_tier":{"anyOf":[{"$ref":"#/components/schemas/ServiceTier"},{"type":"null"}],"description":"The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it)."},"model":{"type":"string","title":"Model","description":"model name","examples":["thenlper/gte-large"]},"input":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"}],"maxLength":1024,"title":"Input","description":"sequences to embed","examples":[["I like chocolate"]],"soft_required":true},"encoding_format":{"type":"string","enum":["float","base64"],"title":"Encoding Format","description":"format used when encoding","default":"float"},"dimensions":{"anyOf":[{"type":"integer","minimum":32.0},{"type":"null"}],"title":"Dimensions","description":"The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros.","examples":[1536,1024,768,512,256,128,64]}},"type":"object","required":["model","input"],"title":"OpenAIEmbeddingsIn"},"OpenAIImageData":{"properties":{"b64_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"B64 Json","description":"The base64-encoded image data"},"revised_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revised Prompt","description":"The prompt used to generate this image"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"The URL of the generated image"}},"type":"object","title":"OpenAIImageData"},"OpenAIImagesEditsIn":{"properties":{"model":{"type":"string","title":"Model","description":"The model to use."},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"The number of images to generate.","default":1},"response_format":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesResponseFormat"},{"type":"null"}],"description":"The format in which the generated images are returned. Currently only b64_json is supported.","default":"b64_json"},"size":{"type":"string","title":"Size","description":"The size of the generated images. Available sizes depend on the model.","default":"1024x1024"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help to monitor and detect abuse."},"image":{"type":"string","format":"binary","title":"Image","description":"Input image bytes for editing task","is_image":true},"prompt":{"type":"string","title":"Prompt","description":"A text description of the desired image edits.","examples":["Add a hat to the cat"]},"mask":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Mask","description":"An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.","is_image":true}},"type":"object","required":["model","image","prompt"],"title":"OpenAIImagesEditsIn"},"OpenAIImagesGenerationsIn":{"properties":{"model":{"type":"string","title":"Model","description":"The model to use for image generation.","examples":["black-forest-labs/FLUX-1-schnell"]},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"The number of images to generate.","default":1},"response_format":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesResponseFormat"},{"type":"null"}],"description":"The format in which the generated images are returned. Currently only b64_json is supported.","default":"b64_json"},"size":{"type":"string","title":"Size","description":"The size of the generated images. Available sizes depend on the model.","default":"1024x1024"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help to monitor and detect abuse."},"prompt":{"type":"string","title":"Prompt","description":"A text description of desired image(s).","examples":["A photo of an astronaut riding a horse on Mars."]},"quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quality","description":"The quality of the image that will be generated."},"style":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Style","description":"The style of the generated images."}},"type":"object","required":["model","prompt"],"title":"OpenAIImagesGenerationsIn"},"OpenAIImagesOut":{"properties":{"created":{"type":"integer","title":"Created","description":"Unix timestamp of when the images were created"},"data":{"items":{"$ref":"#/components/schemas/OpenAIImageData"},"type":"array","title":"Data","description":"List of generated images"}},"type":"object","required":["data"],"title":"OpenAIImagesOut"},"OpenAIImagesResponseFormat":{"type":"string","enum":["b64_json"],"title":"OpenAIImagesResponseFormat"},"OpenAIImagesVariationsIn":{"properties":{"model":{"type":"string","title":"Model","description":"The model to use."},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"The number of images to generate.","default":1},"response_format":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesResponseFormat"},{"type":"null"}],"description":"The format in which the generated images are returned. Currently only b64_json is supported.","default":"b64_json"},"size":{"type":"string","title":"Size","description":"The size of the generated images. Available sizes depend on the model.","default":"1024x1024"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help to monitor and detect abuse."},"image":{"type":"string","format":"binary","title":"Image","description":"Input image bytes for variation task","is_image":true}},"type":"object","required":["model","image"],"title":"OpenAIImagesVariationsIn"},"OpenAIModelOut":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"model"},"created":{"type":"integer","title":"Created"},"owned_by":{"type":"string","title":"Owned By"},"root":{"type":"string","title":"Root"},"parent":{"type":"null","title":"Parent"},"metadata":{"anyOf":[{"$ref":"#/components/schemas/ModelMetadata"},{"type":"null"}]}},"type":"object","required":["id","created","owned_by","root"],"title":"OpenAIModelOut"},"OpenAIModelsOut":{"properties":{"object":{"type":"string","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/OpenAIModelOut"},"type":"array","title":"Data"}},"type":"object","title":"OpenAIModelsOut"},"OpenAITextToSpeechIn":{"properties":{"service_tier":{"anyOf":[{"$ref":"#/components/schemas/ServiceTier"},{"type":"null"}],"description":"The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it)."},"model":{"type":"string","title":"Model","description":"model name","examples":["deepinfra/tts"]},"input":{"type":"string","title":"Input","description":"Text to convert to speech","examples":["I'm beginnin' to feel like a Rap God, Rap God\nAll my people from the front to the back nod, back nod\nNow, who thinks their arms are long enough to slap box, slap box?\nThey said I rap like a robot, so call me Rap-bot"]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice","description":"Preset voices to use for the speech."},"response_format":{"$ref":"#/components/schemas/TtsResponseFormat","description":"response format for the speech"},"speed":{"type":"number","maximum":4.0,"minimum":0.25,"title":"Speed","description":"speed of the speech","default":1.0},"extra_body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Body","description":"Extra body parameters for the model."}},"type":"object","required":["model","input"],"title":"OpenAITextToSpeechIn"},"OpenClawAgentTypeMetaOut":{"properties":{"pretty_name":{"type":"string","title":"Pretty Name","description":"Human-readable display name for the framework"},"version":{"type":"string","title":"Version","description":"Agent framework version"},"has_dashboard":{"type":"boolean","title":"Has Dashboard","description":"Whether instances of this framework expose a dashboard via the nginx proxy. False -> SSH-only; the UI should hide the dashboard launch affordance and surface the SSH connection string instead."},"plans":{"items":{"$ref":"#/components/schemas/OpenClawPlanOut"},"type":"array","title":"Plans","description":"Plans available for this agent type"}},"type":"object","required":["pretty_name","version","has_dashboard","plans"],"title":"OpenClawAgentTypeMetaOut"},"OpenClawBackupOut":{"properties":{"snapshot_name":{"type":"string","title":"Snapshot Name"},"size_in_gb":{"type":"integer","title":"Size In Gb"},"state":{"type":"string","title":"State"},"created_at_unix":{"type":"integer","title":"Created At Unix"}},"type":"object","required":["snapshot_name","size_in_gb","state","created_at_unix"],"title":"OpenClawBackupOut"},"OpenClawCatalogOut":{"additionalProperties":{"$ref":"#/components/schemas/OpenClawAgentTypeMetaOut"},"type":"object","title":"OpenClawCatalogOut","description":"Per-agent-type catalog: keyed by agent_type_id, each entry carries the\ncurrent version and the plans available for that type."},"OpenClawCreateIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Instance name"},"agent_type_id":{"type":"string","title":"Agent Type Id","description":"Agent type identifier","default":"openclaw"},"plan_id":{"type":"string","title":"Plan Id","description":"Plan identifier","default":"standard"}},"type":"object","required":["name"],"title":"OpenClawCreateIn"},"OpenClawCreateOut":{"properties":{"instance_id":{"type":"string","title":"Instance Id","description":"Instance ID"}},"type":"object","required":["instance_id"],"title":"OpenClawCreateOut"},"OpenClawInstanceOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"state":{"$ref":"#/components/schemas/AgentInstanceState"},"start_ts":{"type":"integer","title":"Start Ts"},"state_ts":{"type":"integer","title":"State Ts"},"stop_ts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stop Ts"},"price_per_hour":{"type":"number","title":"Price Per Hour"},"region":{"type":"string","title":"Region"},"last_backup_ts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Backup Ts"},"ssh_port":{"type":"integer","title":"Ssh Port"},"fail_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fail Reason"},"public_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Ip"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"agent_type":{"type":"string","title":"Agent Type"},"plan_id":{"type":"string","title":"Plan Id"}},"type":"object","required":["id","name","state","start_ts","state_ts","stop_ts","price_per_hour","region","last_backup_ts","ssh_port","fail_reason","public_ip","version","agent_type","plan_id"],"title":"OpenClawInstanceOut"},"OpenClawLaunchTokenOut":{"properties":{"dashboard_url":{"type":"string","title":"Dashboard Url","description":"Single-use URL that opens the dashboard. Short TTL; mint right before navigating."}},"type":"object","required":["dashboard_url"],"title":"OpenClawLaunchTokenOut"},"OpenClawPlanOut":{"properties":{"id":{"type":"string","title":"Id","description":"Plan identifier"},"vcpu":{"type":"integer","title":"Vcpu","description":"Number of vCPUs"},"ram_gb":{"type":"integer","title":"Ram Gb","description":"RAM in GB"},"price_per_hour":{"type":"number","title":"Price Per Hour","description":"Price in USD per hour"}},"type":"object","required":["id","vcpu","ram_gb","price_per_hour"],"title":"OpenClawPlanOut"},"OpenClawUpdateIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Instance name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"OpenClawUpdateIn"},"OpenRouterDatacenter":{"properties":{"country_code":{"type":"string","title":"Country Code","description":"ISO 3166 Alpha-2 country code"}},"type":"object","required":["country_code"],"title":"OpenRouterDatacenter"},"OpenRouterModelData":{"properties":{"id":{"type":"string","title":"Id","description":"Model identifier used when calling the provider API"},"hugging_face_id":{"type":"string","title":"Hugging Face Id","description":"HuggingFace model ID if available","default":""},"name":{"type":"string","title":"Name","description":"Human-readable model name"},"created":{"type":"integer","title":"Created","description":"Unix timestamp of model creation"},"input_modalities":{"items":{"type":"string"},"type":"array","title":"Input Modalities","description":"Supported input modalities"},"output_modalities":{"items":{"type":"string"},"type":"array","title":"Output Modalities","description":"Supported output modalities"},"quantization":{"type":"string","title":"Quantization","description":"Model quantization type"},"context_length":{"type":"integer","title":"Context Length","description":"Maximum context length"},"max_output_length":{"type":"integer","title":"Max Output Length","description":"Maximum output length"},"pricing":{"$ref":"#/components/schemas/OpenRouterPricing","description":"Pricing information"},"supported_sampling_parameters":{"items":{"type":"string"},"type":"array","title":"Supported Sampling Parameters","description":"Supported sampling parameters"},"supported_features":{"items":{"type":"string"},"type":"array","title":"Supported Features","description":"Supported features"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Model description"},"deprecation_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deprecation Date","description":"ISO 8601 date YYYY-MM-DD for deprecation"},"openrouter":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Openrouter","description":"OpenRouter specific data"},"datacenters":{"items":{"$ref":"#/components/schemas/OpenRouterDatacenter"},"type":"array","title":"Datacenters","description":"Available datacenters"}},"type":"object","required":["id","name","created","input_modalities","output_modalities","quantization","context_length","max_output_length","pricing","supported_sampling_parameters","supported_features","datacenters"],"title":"OpenRouterModelData"},"OpenRouterModelsOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OpenRouterModelData"},"type":"array","title":"Data","description":"List of available models"}},"type":"object","required":["data"],"title":"OpenRouterModelsOut"},"OpenRouterPricing":{"properties":{"prompt":{"type":"string","title":"Prompt","description":"Pricing per 1 token for input"},"completion":{"type":"string","title":"Completion","description":"Pricing per 1 token for output"},"input_cache_read":{"type":"string","title":"Input Cache Read","description":"Pricing per 1 token for cache reads","default":"0"}},"type":"object","required":["prompt","completion"],"title":"OpenRouterPricing"},"PricingPageEntryOut":{"properties":{"model_name":{"type":"string","title":"Model Name"},"short_name":{"type":"string","title":"Short Name"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens","description":"The maximum context size of this model, if applicable"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/ModelPricingTime"},{"$ref":"#/components/schemas/ModelPricingTokens"},{"$ref":"#/components/schemas/ModelPricingInputLength"},{"$ref":"#/components/schemas/ModelPricingInputTokens"},{"$ref":"#/components/schemas/ModelPricingUptime"},{"$ref":"#/components/schemas/ModelPricingInputCharacterLength"},{"$ref":"#/components/schemas/ModelPricingImageUnits"},{"$ref":"#/components/schemas/ModelPricingOutputLength"},{"$ref":"#/components/schemas/ModelPricingFrameUnits"}],"title":"Pricing"}},"type":"object","required":["model_name","short_name","pricing"],"title":"PricingPageEntryOut"},"PricingPageSectionOut":{"properties":{"section_id":{"type":"string","title":"Section Id"},"ptype":{"$ref":"#/components/schemas/PricingType"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"mf_description":{"type":"string","title":"Mf Description","description":"Model family description for this section, if applicable. Will use description from the section if not set","default":""},"entries":{"items":{"$ref":"#/components/schemas/PricingPageEntryOut"},"type":"array","title":"Entries"}},"type":"object","required":["section_id","ptype","title","description","entries"],"title":"PricingPageSectionOut"},"PricingType":{"type":"string","enum":["tokens","time","uptime","input_length","input_tokens","input_character_length","image_units","output_length","frame_units"],"title":"PricingType"},"RateLimitOut":{"properties":{"rate_limit":{"type":"integer","title":"Rate Limit","description":"Per model outstanding request rate limit"},"tpm_rate_limit":{"type":"integer","title":"Tpm Rate Limit","description":"Per model token per minute rate limit"}},"type":"object","required":["rate_limit","tpm_rate_limit"],"title":"RateLimitOut"},"RateLimitRequestIn":{"properties":{"rate_limit":{"type":"integer","title":"Rate Limit"},"tpm_rate_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tpm Rate Limit"},"reason":{"type":"string","maxLength":2048,"title":"Reason"}},"type":"object","required":["rate_limit","reason"],"title":"RateLimitRequestIn"},"RegexResponseFormat":{"properties":{"type":{"type":"string","const":"regex","title":"Type","default":"regex"},"regex":{"type":"string","title":"Regex","description":"Regex pattern for structured output when type is 'regex'"}},"type":"object","required":["regex"],"title":"RegexResponseFormat"},"RequestCostItem":{"properties":{"requestId":{"type":"string","title":"Requestid"},"costNanoUsd":{"type":"integer","title":"Costnanousd"}},"type":"object","required":["requestId","costNanoUsd"],"title":"RequestCostItem"},"RequestCostQuery":{"properties":{"requestIds":{"items":{"type":"string"},"type":"array","title":"Requestids"}},"type":"object","required":["requestIds"],"title":"RequestCostQuery"},"RequestCostResponse":{"properties":{"requests":{"items":{"$ref":"#/components/schemas/RequestCostItem"},"type":"array","title":"Requests"}},"type":"object","required":["requests"],"title":"RequestCostResponse"},"ScaleSettings":{"properties":{"min_instances":{"type":"integer","title":"Min Instances","description":"Minimum number of model instances to run","default":1},"max_instances":{"type":"integer","title":"Max Instances","description":"Maximum number of model instances to run","default":1}},"type":"object","title":"ScaleSettings"},"SchemaOut":{"properties":{"variant":{"$ref":"#/components/schemas/SchemaVariant"},"schema_in":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema In"},"schema_out":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema Out"},"schema_stream":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema Stream"},"fields_in":{"items":{"$ref":"#/components/schemas/ModelFieldInfo"},"type":"array","title":"Fields In"}},"type":"object","required":["variant","fields_in"],"title":"SchemaOut"},"SchemaVariant":{"properties":{"key":{"$ref":"#/components/schemas/SchemaVariantKey"},"url":{"type":"string","title":"Url"}},"type":"object","required":["key","url"],"title":"SchemaVariant"},"SchemaVariantKey":{"type":"string","enum":["default","openai-completions","openai-chat-completions","openai-embeddings","openai-speech-to-text","openai-tts","openai-images","openai-images-variations","openai-images-edits","elevenlabs-tts","create-voice","read-voice","update-voice","delete-voice","list-voices","ai-sdk"],"title":"SchemaVariantKey"},"ScopedJWTIn":{"properties":{"api_key_name":{"type":"string","title":"Api Key Name"},"models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Models","description":"allow inference only to the specified model names"},"expires_delta":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires Delta","description":"how many seconds in the future should the token be valid for"},"expires_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires At","description":"unix timestamp when the token should expire"},"spending_limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spending Limit","description":"only allow spending that much USD until the token becomes invalid"}},"type":"object","required":["api_key_name"],"title":"ScopedJWTIn"},"ScopedJWTOut":{"properties":{"token":{"type":"string","title":"Token","description":"The newly minted scoped JWT ready for use"}},"type":"object","required":["token"],"title":"ScopedJWTOut"},"ServiceTier":{"type":"string","enum":["default","priority"],"title":"ServiceTier"},"SourceModel":{"properties":{"type":{"$ref":"#/components/schemas/SourceTypeEnum"},"civit_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Civit Url"}},"type":"object","required":["type"],"title":"SourceModel"},"SourceTypeEnum":{"type":"string","enum":["civitai"],"title":"SourceTypeEnum"},"SshKeyIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"SSH Key name"},"key":{"type":"string","maxLength":32000,"minLength":1,"title":"Key","description":"SSH Key content"}},"type":"object","required":["name","key"],"title":"SshKeyIn"},"SshKeyOut":{"properties":{"id":{"type":"string","title":"Id","description":"SSH Key ID"},"name":{"type":"string","minLength":1,"title":"Name","description":"SSH Key name"},"key":{"type":"string","minLength":1,"title":"Key","description":"SSH Key content"},"created_at":{"type":"integer","title":"Created At"}},"type":"object","required":["id","name","key"],"title":"SshKeyOut"},"StreamOptions":{"properties":{"include_usage":{"type":"boolean","title":"Include Usage","description":"whether to include usage data","default":true},"continuous_usage_stats":{"type":"boolean","title":"Continuous Usage Stats","description":"whether to include usage stats continuously with each streaming event","default":false}},"type":"object","title":"StreamOptions"},"TextResponseFormat":{"properties":{"type":{"type":"string","const":"text","title":"Type","default":"text"}},"type":"object","title":"TextResponseFormat"},"TimeDeploymentStatsOut":{"properties":{"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"},"total_time_s":{"type":"integer","title":"Total Time S","description":"total number of seconds spend in inference"},"total_amount_cents":{"type":"integer","title":"Total Amount Cents","description":"total number of cents spent"},"avg_time_ms":{"type":"number","title":"Avg Time Ms","description":"average millisecond inference time"},"avg95_time_ms":{"type":"number","title":"Avg95 Time Ms","description":"95th percentile inference time (estimated)"},"errors":{"type":"integer","title":"Errors","description":"number of errors"}},"type":"object","required":["requests","total_time_s","total_amount_cents","avg_time_ms","avg95_time_ms","errors"],"title":"TimeDeploymentStatsOut"},"TtsResponseFormat":{"type":"string","enum":["mp3","opus","flac","wav","pcm"],"title":"TtsResponseFormat","description":"Select the desired format for the speech output. Supported formats include mp3, opus, flac, wav, and pcm.","default":"wav","examples":["mp3","opus","flac","wav","pcm"]},"UpdateLoraApiRequest":{"properties":{"private":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Private"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"UpdateLoraApiRequest"},"VideoURL":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"VideoURL"},"Voice":{"properties":{"user_id":{"type":"string","title":"User Id"},"voice_id":{"type":"string","title":"Voice Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description","default":""},"created_at":{"type":"integer","title":"Created At"},"updated_at":{"type":"integer","title":"Updated At"}},"type":"object","required":["user_id","voice_id","name"],"title":"Voice"},"WebLiveMetricsOut":{"properties":{"tokens_per_second":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tokens Per Second","description":"Tokens per second"},"time_to_first_token":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Time To First Token","description":"Time to first token in seconds"},"requests_per_second":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Requests Per Second","description":"Requests per second"},"total_tflops":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Tflops","description":"Total TFLOPS"}},"type":"object","required":["tokens_per_second","time_to_first_token","requests_per_second","total_tflops"],"title":"WebLiveMetricsOut"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"Chat Completions","description":"OpenAI and Anthropic-compatible chat completion endpoints for LLMs."},{"name":"Text Completions","description":"OpenAI-compatible text completion endpoints."},{"name":"Embeddings","description":"Generate text embeddings for search and RAG."},{"name":"Image Generation","description":"Generate, edit, and create variations of images."},{"name":"Audio","description":"OpenAI-compatible speech synthesis, transcription, and translation."},{"name":"Text to Speech","description":"ElevenLabs-compatible TTS endpoints and voice management."},{"name":"Inference","description":"Native DeepInfra inference API for models and deployments."},{"name":"Dedicated Models","description":"Deploy and manage private model instances with autoscaling."},{"name":"GPU Rentals","description":"Rent dedicated GPU containers."},{"name":"Models","description":"Browse, search, and manage AI models."},{"name":"Files & Batches","description":"File uploads and batch processing."},{"name":"LoRA Adapters","description":"Create, manage, and query LoRA adapter models."},{"name":"Agents","description":"Manage agent-framework instances (OpenClaw and friends)."},{"name":"Account","description":"User profile, team management, and rate limits."},{"name":"Authentication","description":"API tokens, SSH keys, scoped JWTs, and login flows."},{"name":"Billing","description":"Payment methods, usage tracking, and billing."},{"name":"Logs & Metrics","description":"Query inference logs, deployment logs, and usage metrics."},{"name":"Utilities","description":"Feedback submission and CLI version."}]} \ No newline at end of file